mimbres commited on
Commit
5d24547
·
verified ·
1 Parent(s): 6309e8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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
- '--file-access-retries', '10',
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