Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -69,6 +69,8 @@ def convert_video(video_file, quality, aspect_ratio, video_url, api_key, upload,
|
|
69 |
# Check if resolution is a list, if not convert it to a list
|
70 |
resolution = [resolution] if not isinstance(resolution, list) else resolution
|
71 |
|
|
|
|
|
72 |
for res in resolution:
|
73 |
# Skip if res is boolean
|
74 |
if isinstance(res, bool):
|
@@ -104,6 +106,10 @@ def convert_video(video_file, quality, aspect_ratio, video_url, api_key, upload,
|
|
104 |
|
105 |
# We need to modify this part if you want to return all converted videos
|
106 |
# Here we only return the last converted video
|
|
|
|
|
|
|
|
|
107 |
output_copy_path = shutil.copy2(output_path, tempfile.gettempdir())
|
108 |
|
109 |
if upload:
|
|
|
69 |
# Check if resolution is a list, if not convert it to a list
|
70 |
resolution = [resolution] if not isinstance(resolution, list) else resolution
|
71 |
|
72 |
+
output_path = None # Define output_path before the loop
|
73 |
+
|
74 |
for res in resolution:
|
75 |
# Skip if res is boolean
|
76 |
if isinstance(res, bool):
|
|
|
106 |
|
107 |
# We need to modify this part if you want to return all converted videos
|
108 |
# Here we only return the last converted video
|
109 |
+
# Check if output_path is None after the loop
|
110 |
+
if output_path is None:
|
111 |
+
return "No resolution was selected."
|
112 |
+
|
113 |
output_copy_path = shutil.copy2(output_path, tempfile.gettempdir())
|
114 |
|
115 |
if upload:
|