mimbres commited on
Commit
68bafc5
·
verified ·
1 Parent(s): 54a1a79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -66,7 +66,7 @@ def prepare_media(source_path_or_url: os.PathLike,
66
  audio_file = source_path_or_url
67
  elif source_type == 'youtube_url':
68
  proxy_handler = {"http": "http://127.0.0.1:1087", "https":"http://127.0.0.1:1087"}
69
- yt = YouTube(source_path_or_url, proxies=proxy_handler)
70
  audio_stream = min(yt.streams.filter(only_audio=True), key=lambda s: s.bitrate)
71
  mp4_file = audio_stream.download(output_path='downloaded') # ./downloaded
72
  audio_file = mp4_file[:-3] + 'mp3'
 
66
  audio_file = source_path_or_url
67
  elif source_type == 'youtube_url':
68
  proxy_handler = {"http": "http://127.0.0.1:1087", "https":"http://127.0.0.1:1087"}
69
+ yt = YouTube(source_path_or_url, use_oauth=true, proxies=proxy_handler)
70
  audio_stream = min(yt.streams.filter(only_audio=True), key=lambda s: s.bitrate)
71
  mp4_file = audio_stream.download(output_path='downloaded') # ./downloaded
72
  audio_file = mp4_file[:-3] + 'mp3'