Update app.py
Browse files
app.py
CHANGED
@@ -141,14 +141,14 @@ def generate_video():
|
|
141 |
raise Exception(f"Error from Space B: {response.text}")
|
142 |
|
143 |
with ThreadPoolExecutor(max_workers=10) as executor:
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
|
153 |
video_path = video_com(lines)
|
154 |
#for img in image_files:
|
|
|
141 |
raise Exception(f"Error from Space B: {response.text}")
|
142 |
|
143 |
with ThreadPoolExecutor(max_workers=10) as executor:
|
144 |
+
for id, line in enumerate(lines):
|
145 |
+
url = space_b_urls[id % len(space_b_urls)] # reuse if more lines than URLs
|
146 |
+
futures.append(executor.submit(send_request_to_space, id, lines, url))
|
147 |
+
|
148 |
+
for future in as_completed(futures):
|
149 |
+
result = future.result()
|
150 |
+
if result:
|
151 |
+
video_paths.append(result)
|
152 |
|
153 |
video_path = video_com(lines)
|
154 |
#for img in image_files:
|