Update app.py
Browse files
app.py
CHANGED
@@ -225,8 +225,14 @@ def process_video(video_url, audio_url, progress=gr.Progress()):
|
|
225 |
progress(0.5, desc="Initiating lipsync...")
|
226 |
job_data = lipsync_api_call(video_url, audio_url)
|
227 |
|
228 |
-
if
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
print(f"[ERROR] API error: {error_msg}")
|
231 |
raise Exception(error_msg)
|
232 |
|
|
|
225 |
progress(0.5, desc="Initiating lipsync...")
|
226 |
job_data = lipsync_api_call(video_url, audio_url)
|
227 |
|
228 |
+
# Check if we have a valid job ID
|
229 |
+
if "id" not in job_data:
|
230 |
+
print("[ERROR] No job ID in response")
|
231 |
+
raise Exception("No job ID received from API")
|
232 |
+
|
233 |
+
# Only treat as error if error field has actual error message
|
234 |
+
if job_data.get("error") not in [None, ""]:
|
235 |
+
error_msg = job_data["error"]
|
236 |
print(f"[ERROR] API error: {error_msg}")
|
237 |
raise Exception(error_msg)
|
238 |
|