Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -88,9 +88,12 @@ def prepare_media(source_path_or_url: os.PathLike,
|
|
88 |
# Try alternative
|
89 |
print(f"Failed with PyTube, error: {e}. Trying yt-dlp...")
|
90 |
audio_file = './downloaded/yt_audio'
|
91 |
-
subprocess.run(['yt-dlp', '-x', source_path_or_url, '-f', 'bestaudio',
|
|
|
|
|
|
|
92 |
'-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
93 |
-
'--force-overwrites'
|
94 |
audio_file += '.mp3'
|
95 |
except Exception as e:
|
96 |
print(f"Alternative downloader failed, error: {e}. Please try again later!")
|
|
|
88 |
# Try alternative
|
89 |
print(f"Failed with PyTube, error: {e}. Trying yt-dlp...")
|
90 |
audio_file = './downloaded/yt_audio'
|
91 |
+
# subprocess.run(['yt-dlp', '-x', source_path_or_url, '-f', 'bestaudio',
|
92 |
+
# '-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
93 |
+
# '--force-overwrites', '--cookies', 'amt/src/extras/c.txt'])
|
94 |
+
subprocess.run(['yt-dlp', '-x', source_path_or_url, '-f',
|
95 |
'-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
96 |
+
'--force-overwrites'])
|
97 |
audio_file += '.mp3'
|
98 |
except Exception as e:
|
99 |
print(f"Alternative downloader failed, error: {e}. Please try again later!")
|