Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,8 @@ def prepare_media(source_path_or_url: os.PathLike,
|
|
67 |
# Download from youtube
|
68 |
try:
|
69 |
# Try PyTube first
|
70 |
-
|
|
|
71 |
audio_stream = min(yt.streams.filter(only_audio=True), key=lambda s: s.bitrate)
|
72 |
mp4_file = audio_stream.download(output_path='downloaded') # ./downloaded
|
73 |
audio_file = mp4_file[:-3] + 'mp3'
|
|
|
67 |
# Download from youtube
|
68 |
try:
|
69 |
# Try PyTube first
|
70 |
+
proxy_handler = { "http": "http://127.0.0.1:1087",'https':'http://127.0.0.1:1087'}
|
71 |
+
yt = YouTube(source_path_or_url, proxies=proxy_handler)
|
72 |
audio_stream = min(yt.streams.filter(only_audio=True), key=lambda s: s.bitrate)
|
73 |
mp4_file = audio_stream.download(output_path='downloaded') # ./downloaded
|
74 |
audio_file = mp4_file[:-3] + 'mp3'
|