diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-23 09:35:23 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-23 09:46:54 +0530 |
commit | ad34b2951e21c88a44b8909fadd113958151acec (patch) | |
tree | 1ea85795c38832f6081834db8f3f7a6e9d6847e0 | |
parent | c8fa48fd948f57bb88b275d45da7642f92eee0f1 (diff) | |
download | hypervideo-pre-ad34b2951e21c88a44b8909fadd113958151acec.tar.lz hypervideo-pre-ad34b2951e21c88a44b8909fadd113958151acec.tar.xz hypervideo-pre-ad34b2951e21c88a44b8909fadd113958151acec.zip |
Try all clients even if age-gated
Reverts: https://github.com/yt-dlp/yt-dlp/pull/536/commits/892e31ce7c5f66418fee26a24eda30e5fe79d901
If some API calls have any issue, saving the state will cause unnecessary errors
-rw-r--r-- | yt_dlp/extractor/youtube.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 04d32e21a..23cf82834 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2444,12 +2444,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor): webpage, self._YT_INITIAL_PLAYER_RESPONSE_RE, video_id, 'initial player response') - age_gated = False for client in clients: player_ytcfg = master_ytcfg if client == 'web' else {} - if age_gated: - pr = None - elif client == 'web' and initial_pr: + if client == 'web' and initial_pr: pr = initial_pr else: if client == 'web_music' and 'configs' not in self._configuration_arg('player_skip'): @@ -2461,8 +2458,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): client, video_id, player_ytcfg or master_ytcfg, player_ytcfg, identity_token, player_url, initial_pr) if pr: yield pr - if age_gated or traverse_obj(pr, ('playabilityStatus', 'reason')) in self._AGE_GATE_REASONS: - age_gated = True + if traverse_obj(pr, ('playabilityStatus', 'reason')) in self._AGE_GATE_REASONS: pr = self._extract_age_gated_player_response( client, video_id, player_ytcfg or master_ytcfg, identity_token, player_url, initial_pr) if pr: |