1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 22:55:18 +00:00

[ie/youtube] Add player_params extractor arg (#7719)

Authored by: coletdjnz
This commit is contained in:
coletdjnz
2023-07-29 18:20:42 +12:00
committed by GitHub
parent 4bf912282a
commit ba06d77a31
2 changed files with 9 additions and 3 deletions

View File

@@ -3583,8 +3583,6 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
def _is_unplayable(player_response):
return traverse_obj(player_response, ('playabilityStatus', 'status')) == 'UNPLAYABLE'
_PLAYER_PARAMS = 'CgIQBg=='
def _extract_player_response(self, client, video_id, master_ytcfg, player_ytcfg, player_url, initial_pr, smuggled_data):
session_index = self._extract_session_index(player_ytcfg, master_ytcfg)
@@ -3597,7 +3595,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'videoId': video_id,
}
if _split_innertube_client(client)[0] == 'android':
yt_query['params'] = self._PLAYER_PARAMS
yt_query['params'] = 'CgIQBg=='
pp_arg = self._configuration_arg('player_params', [None])[0]
if pp_arg:
yt_query['params'] = pp_arg
yt_query.update(self._generate_player_context(sts))
return self._extract_response(
@@ -4016,6 +4018,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
webpage = None
if 'webpage' not in self._configuration_arg('player_skip'):
query = {'bpctr': '9999999999', 'has_verified': '1'}
pp = self._configuration_arg('player_params', [None])[0]
if pp:
query['pp'] = pp
webpage = self._download_webpage(
webpage_url, video_id, fatal=False, query=query)