neuralworm commited on
Commit
b02f29d
·
verified ·
1 Parent(s): 1263724

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,8 +15,8 @@ def get_audio(url):
15
  }
16
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
17
  info = ydl.extract_info(url, download=True)
18
- # Use ydl_opts['_filename'] to get the downloaded file path
19
- audio_file = ydl_opts['_filename']
20
  return audio_file
21
  except Exception as e:
22
  raise gr.Error(f"Exception: {e}")
 
15
  }
16
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
17
  info = ydl.extract_info(url, download=True)
18
+ # Use 'filepath' from the info dictionary to get the downloaded file path
19
+ audio_file = info['filepath']
20
  return audio_file
21
  except Exception as e:
22
  raise gr.Error(f"Exception: {e}")