Update app.py
Browse files
app.py
CHANGED
@@ -73,7 +73,7 @@ def prepare_media(source_path_or_url: os.PathLike,
|
|
73 |
audio_file = './downloaded/yt_audio'
|
74 |
command = ['yt-dlp', '-x', source_path_or_url, '-f', 'bestaudio',
|
75 |
'-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
76 |
-
'--
|
77 |
'--force-overwrites', '--username', 'oauth2', '--password', '', '-v']
|
78 |
if simulate:
|
79 |
command = command + ['-s']
|
@@ -86,7 +86,9 @@ def prepare_media(source_path_or_url: os.PathLike,
|
|
86 |
if "www.google.com/device" in line:
|
87 |
hl_text = line.replace("https://www.google.com/device", "\033[93mhttps://www.google.com/device\x1b[0m").split()
|
88 |
hl_text[-1] = "\x1b[31;1m" + hl_text[-1] + "\x1b[0m"
|
89 |
-
lf.write(' '.join(hl_text)); lf.flush()
|
|
|
|
|
90 |
process.stdout.close()
|
91 |
process.wait()
|
92 |
|
|
|
73 |
audio_file = './downloaded/yt_audio'
|
74 |
command = ['yt-dlp', '-x', source_path_or_url, '-f', 'bestaudio',
|
75 |
'-o', audio_file, '--audio-format', 'mp3', '--restrict-filenames',
|
76 |
+
'--extractor-retries', '10',
|
77 |
'--force-overwrites', '--username', 'oauth2', '--password', '', '-v']
|
78 |
if simulate:
|
79 |
command = command + ['-s']
|
|
|
86 |
if "www.google.com/device" in line:
|
87 |
hl_text = line.replace("https://www.google.com/device", "\033[93mhttps://www.google.com/device\x1b[0m").split()
|
88 |
hl_text[-1] = "\x1b[31;1m" + hl_text[-1] + "\x1b[0m"
|
89 |
+
lf.write(' '.join(hl_text)); lf.flush()
|
90 |
+
elif "Authorization successful" in line or "Video unavailable" in line:
|
91 |
+
lf.write(line); lf.flush()
|
92 |
process.stdout.close()
|
93 |
process.wait()
|
94 |
|