Only use android URLs if encrypted; they randomly go 403
Android URLs now begin returning 403s mid playback at random.
This commit is contained in:
parent
e54596f3e9
commit
9859c5485e
@ -431,13 +431,18 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None):
|
|||||||
# couldn't be decrypted with the base.js from the web page for some
|
# couldn't be decrypted with the base.js from the web page for some
|
||||||
# reason
|
# reason
|
||||||
# https://github.com/yt-dlp/yt-dlp/issues/574#issuecomment-887171136
|
# https://github.com/yt-dlp/yt-dlp/issues/574#issuecomment-887171136
|
||||||
|
|
||||||
|
# Update 4/26/23, these URLs will randomly start returning 403
|
||||||
|
# mid-playback and I'm not sure why
|
||||||
gevent.spawn(fetch_player_response, 'android', video_id)
|
gevent.spawn(fetch_player_response, 'android', video_id)
|
||||||
)
|
)
|
||||||
gevent.joinall(tasks)
|
gevent.joinall(tasks)
|
||||||
util.check_gevent_exceptions(*tasks)
|
util.check_gevent_exceptions(*tasks)
|
||||||
info, player_response = tasks[0].value, tasks[1].value
|
info, player_response = tasks[0].value, tasks[1].value
|
||||||
|
|
||||||
yt_data_extract.update_with_new_urls(info, player_response)
|
if yt_data_extract.requires_decryption(info):
|
||||||
|
print('Encrypted. Replacing with URLs from Android client')
|
||||||
|
yt_data_extract.update_with_new_urls(info, player_response)
|
||||||
|
|
||||||
# Age restricted video, retry
|
# Age restricted video, retry
|
||||||
if info['age_restricted'] or info['player_urls_missing']:
|
if info['age_restricted'] or info['player_urls_missing']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user