pukkandan 2021-06-18 20:32:52 +05:30
parent 9fea350f0d
commit 4e6767b5f2
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698

View File

@ -1876,6 +1876,16 @@ def _extract_comments(self, ytcfg, video_id, contents, webpage, xsrf_token):
'comment_count': len(comments), 'comment_count': len(comments),
} }
@staticmethod
def _get_video_info_params(video_id):
return {
'video_id': video_id,
'eurl': 'https://youtube.googleapis.com/v/' + video_id,
'html5': '1',
'c': 'TVHTML5',
'cver': '6.20180913',
}
def _real_extract(self, url): def _real_extract(self, url):
url, smuggled_data = unsmuggle_url(url, {}) url, smuggled_data = unsmuggle_url(url, {})
video_id = self._match_id(url) video_id = self._match_id(url)
@ -1908,13 +1918,11 @@ def get_text(x):
base_url + 'get_video_info', video_id, base_url + 'get_video_info', video_id,
'Fetching youtube music info webpage', 'Fetching youtube music info webpage',
'unable to download youtube music info webpage', query={ 'unable to download youtube music info webpage', query={
'video_id': video_id, **self._get_video_info_params(video_id),
'eurl': 'https://youtube.googleapis.com/v/' + video_id,
'el': 'detailpage', 'el': 'detailpage',
'c': 'WEB_REMIX', 'c': 'WEB_REMIX',
'cver': '0.1', 'cver': '0.1',
'cplayer': 'UNIPLAYER', 'cplayer': 'UNIPLAYER',
'html5': '1',
}, fatal=False)), }, fatal=False)),
lambda x: x['player_response'][0], lambda x: x['player_response'][0],
compat_str) or '{}', video_id) compat_str) or '{}', video_id)
@ -1936,12 +1944,8 @@ def get_text(x):
pr = self._parse_json(try_get(compat_parse_qs( pr = self._parse_json(try_get(compat_parse_qs(
self._download_webpage( self._download_webpage(
base_url + 'get_video_info', video_id, base_url + 'get_video_info', video_id,
'Refetching age-gated info webpage', 'Refetching age-gated info webpage', 'unable to download video info webpage',
'unable to download video info webpage', query={ query=self._get_video_info_params(video_id), fatal=False)),
'video_id': video_id,
'eurl': 'https://youtube.googleapis.com/v/' + video_id,
'html5': '1',
}, fatal=False)),
lambda x: x['player_response'][0], lambda x: x['player_response'][0],
compat_str) or '{}', video_id) compat_str) or '{}', video_id)
if pr: if pr: