Update app.py
Browse files
app.py
CHANGED
@@ -34,14 +34,14 @@ def generate_video():
|
|
34 |
line = raw_lines[i].strip()
|
35 |
|
36 |
# Check if current line is a heading
|
37 |
-
if line.endswith('?') or line.endswith('
|
38 |
block = line # Start block with heading
|
39 |
i += 1
|
40 |
|
41 |
# Add next 3–5 paragraph lines (or until next heading)
|
42 |
paragraph_lines = []
|
43 |
count = 0
|
44 |
-
while i < len(raw_lines) and not (raw_lines[i].strip().endswith('?') or raw_lines[i].strip().endswith('
|
45 |
paragraph_lines.append(raw_lines[i])
|
46 |
i += 1
|
47 |
count += 1
|
@@ -52,9 +52,9 @@ def generate_video():
|
|
52 |
lines.append(block)
|
53 |
else:
|
54 |
# If not a heading, just group normal 5 lines
|
55 |
-
block = '\n'.join(raw_lines[i:i+
|
56 |
lines.append(block)
|
57 |
-
i +=
|
58 |
|
59 |
image_olst=[]
|
60 |
for id in range(len(lines)):
|
|
|
34 |
line = raw_lines[i].strip()
|
35 |
|
36 |
# Check if current line is a heading
|
37 |
+
if line.endswith('?') or line.endswith(':'):
|
38 |
block = line # Start block with heading
|
39 |
i += 1
|
40 |
|
41 |
# Add next 3–5 paragraph lines (or until next heading)
|
42 |
paragraph_lines = []
|
43 |
count = 0
|
44 |
+
while i < len(raw_lines) and not (raw_lines[i].strip().endswith('?') or raw_lines[i].strip().endswith(':')) and count < 4:
|
45 |
paragraph_lines.append(raw_lines[i])
|
46 |
i += 1
|
47 |
count += 1
|
|
|
52 |
lines.append(block)
|
53 |
else:
|
54 |
# If not a heading, just group normal 5 lines
|
55 |
+
block = '\n'.join(raw_lines[i:i+4])
|
56 |
lines.append(block)
|
57 |
+
i += 4
|
58 |
|
59 |
image_olst=[]
|
60 |
for id in range(len(lines)):
|