muhtasham commited on
Commit
f275e60
·
1 Parent(s): 1be1f18
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -145,7 +145,7 @@ def download_youtube_audio(url):
145
  "function": "sieve/youtube-downloader",
146
  "inputs": {
147
  "url": url,
148
- "download_type": "audio", # Ensure we're only downloading audio
149
  "resolution": "highest-available",
150
  "include_audio": True,
151
  "start_time": 0,
@@ -214,7 +214,6 @@ def download_youtube_audio(url):
214
  )
215
  job_response.raise_for_status()
216
  job_data = job_response.json()
217
- # logger.debug(f"Job status response: {job_data}")
218
 
219
  status = job_data.get("status")
220
  if status != last_status:
@@ -222,6 +221,7 @@ def download_youtube_audio(url):
222
  last_status = status
223
 
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", [])
@@ -245,7 +245,7 @@ def download_youtube_audio(url):
245
 
246
  # Download the audio file
247
  logger.info("Downloading audio file from Sieve storage...")
248
- audio_response = requests.get(audio_url, timeout=30)
249
  audio_response.raise_for_status()
250
 
251
  file_size = len(audio_response.content)
 
145
  "function": "sieve/youtube-downloader",
146
  "inputs": {
147
  "url": url,
148
+ "download_type": "audio",
149
  "resolution": "highest-available",
150
  "include_audio": True,
151
  "start_time": 0,
 
214
  )
215
  job_response.raise_for_status()
216
  job_data = job_response.json()
 
217
 
218
  status = job_data.get("status")
219
  if status != last_status:
 
221
  last_status = status
222
 
223
  if status == "completed" or status == "finished":
224
+ logger.debug(f"Job status response: {job_data}")
225
  logger.info("Job completed successfully")
226
  # Get the output data
227
  output_data = job_data.get("outputs", [])
 
245
 
246
  # Download the audio file
247
  logger.info("Downloading audio file from Sieve storage...")
248
+ audio_response = requests.get(audio_url, timeout=1800)
249
  audio_response.raise_for_status()
250
 
251
  file_size = len(audio_response.content)