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

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
- # Get the output filename from the 'filepath' key of the info dictionary
19
- audio_file = info['filepath']
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 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}")