dinhhan commited on
Commit
25494c5
·
verified ·
1 Parent(s): f9ec5ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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 "error" in job_data or "message" in job_data:
229
- error_msg = job_data.get("error", job_data.get("message", "Unknown error"))
 
 
 
 
 
 
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