Try all clients even if age-gated

Reverts: 892e31ce7c

If some API calls have any issue, saving the state will cause unnecessary errors
This commit is contained in:
pukkandan 2021-07-23 09:35:23 +05:30
parent c8fa48fd94
commit ad34b2951e
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698

View File

@ -2444,12 +2444,9 @@ def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, pl
webpage, self._YT_INITIAL_PLAYER_RESPONSE_RE, webpage, self._YT_INITIAL_PLAYER_RESPONSE_RE,
video_id, 'initial player response') video_id, 'initial player response')
age_gated = False
for client in clients: for client in clients:
player_ytcfg = master_ytcfg if client == 'web' else {} player_ytcfg = master_ytcfg if client == 'web' else {}
if age_gated: if client == 'web' and initial_pr:
pr = None
elif client == 'web' and initial_pr:
pr = initial_pr pr = initial_pr
else: else:
if client == 'web_music' and 'configs' not in self._configuration_arg('player_skip'): 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) client, video_id, player_ytcfg or master_ytcfg, player_ytcfg, identity_token, player_url, initial_pr)
if pr: if pr:
yield pr yield pr
if age_gated or traverse_obj(pr, ('playabilityStatus', 'reason')) in self._AGE_GATE_REASONS: if traverse_obj(pr, ('playabilityStatus', 'reason')) in self._AGE_GATE_REASONS:
age_gated = True
pr = self._extract_age_gated_player_response( pr = self._extract_age_gated_player_response(
client, video_id, player_ytcfg or master_ytcfg, identity_token, player_url, initial_pr) client, video_id, player_ytcfg or master_ytcfg, identity_token, player_url, initial_pr)
if pr: if pr: