]> jfr.im git - yt-dlp.git/commitdiff
Try all clients even if age-gated
authorpukkandan <redacted>
Fri, 23 Jul 2021 04:05:23 +0000 (09:35 +0530)
committerpukkandan <redacted>
Fri, 23 Jul 2021 04:16:54 +0000 (09:46 +0530)
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

yt_dlp/extractor/youtube.py

index 04d32e21aa9c536fc82531c91533d483946b0a2f..23cf828340a5eead975d88b320b82c26c608aef0 100644 (file)
@@ -2444,12 +2444,9 @@ def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, pl
                 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 @@ def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, pl
                     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: