Spaces:
Running
Running
WIP
Browse files
app.py
CHANGED
@@ -224,15 +224,21 @@ def download_youtube_audio(url):
|
|
224 |
if status == "completed" or status == "finished":
|
225 |
logger.info("Job completed successfully")
|
226 |
# Get the output data
|
227 |
-
output_data = job_data.get("
|
228 |
if not output_data:
|
229 |
-
logger.error("No output data found in completed job response")
|
230 |
raise gr.Error("No output data in job response")
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
# Get the audio URL from the output
|
233 |
-
audio_url =
|
234 |
if not audio_url:
|
235 |
-
logger.error("No audio URL found in output data")
|
236 |
raise gr.Error("No audio URL in output data")
|
237 |
|
238 |
logger.info(f"Received audio URL from Sieve: {audio_url}")
|
|
|
224 |
if status == "completed" or status == "finished":
|
225 |
logger.info("Job completed successfully")
|
226 |
# Get the output data
|
227 |
+
output_data = job_data.get("outputs", [])
|
228 |
if not output_data:
|
229 |
+
logger.error(f"No output data found in completed job response. Full response: {job_data}")
|
230 |
raise gr.Error("No output data in job response")
|
231 |
|
232 |
+
# Get the first output which should contain the audio URL
|
233 |
+
first_output = output_data[0]
|
234 |
+
if not isinstance(first_output, dict):
|
235 |
+
logger.error(f"Unexpected output format: {first_output}")
|
236 |
+
raise gr.Error("Unexpected output format from job response")
|
237 |
+
|
238 |
# Get the audio URL from the output
|
239 |
+
audio_url = first_output.get("url")
|
240 |
if not audio_url:
|
241 |
+
logger.error(f"No audio URL found in output data. Output data: {first_output}")
|
242 |
raise gr.Error("No audio URL in output data")
|
243 |
|
244 |
logger.info(f"Received audio URL from Sieve: {audio_url}")
|