Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -76,9 +76,12 @@ def prepare_media(source_path_or_url: os.PathLike,
|
|
76 |
# Try alternative
|
77 |
print(f"Failed with PyTube, error: {e}. Trying yt-dlp...")
|
78 |
audio_file = './downloaded/yt_audio'
|
|
|
|
|
|
|
79 |
subprocess.run(['yt-dlp', '-x', source_path_or_url, '-f', 'bestaudio',
|
80 |
'-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
81 |
-
'--force-overwrites'
|
82 |
audio_file += '.mp3'
|
83 |
except Exception as e:
|
84 |
print(f"Alternative downloader failed, error: {e}. Please try again later!")
|
|
|
76 |
# Try alternative
|
77 |
print(f"Failed with PyTube, error: {e}. Trying yt-dlp...")
|
78 |
audio_file = './downloaded/yt_audio'
|
79 |
+
# subprocess.run(['yt-dlp', '-x', source_path_or_url, '-f', 'bestaudio',
|
80 |
+
# '-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
81 |
+
# '--force-overwrites', '--cookies', 'amt/src/extras/c.txt'])
|
82 |
subprocess.run(['yt-dlp', '-x', source_path_or_url, '-f', 'bestaudio',
|
83 |
'-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
84 |
+
'--force-overwrites'])
|
85 |
audio_file += '.mp3'
|
86 |
except Exception as e:
|
87 |
print(f"Alternative downloader failed, error: {e}. Please try again later!")
|