Update app.py
Browse files
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, use_oauth=
|
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, allow_oauth_cache=False)
|
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'
|