[ie/youtube] Request web_safari & web_creator client configs (#16198)
Closes #16144 Authored by: bashonly
This commit is contained in:
parent
f2bd3202c0
commit
48a61d0f38
3 changed files with 22 additions and 6 deletions
|
|
@ -957,15 +957,23 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|||
url = {
|
||||
'mweb': 'https://m.youtube.com',
|
||||
'web': 'https://www.youtube.com',
|
||||
'web_safari': 'https://www.youtube.com',
|
||||
'web_music': 'https://music.youtube.com',
|
||||
'web_creator': 'https://studio.youtube.com',
|
||||
'web_embedded': f'https://www.youtube.com/embed/{video_id}?html5=1',
|
||||
'tv': 'https://www.youtube.com/tv',
|
||||
}.get(client)
|
||||
if not url:
|
||||
return {}
|
||||
|
||||
default_ytcfg = self._get_default_ytcfg(client)
|
||||
|
||||
if default_ytcfg['REQUIRE_AUTH'] and not self.is_authenticated:
|
||||
return {}
|
||||
|
||||
webpage = self._download_webpage_with_retries(
|
||||
url, video_id, note=f'Downloading {client.replace("_", " ").strip()} client config',
|
||||
headers=traverse_obj(self._get_default_ytcfg(client), {
|
||||
headers=traverse_obj(default_ytcfg, {
|
||||
'User-Agent': ('INNERTUBE_CONTEXT', 'client', 'userAgent', {str}),
|
||||
'Referer': ('INNERTUBE_CONTEXT', 'thirdParty', 'embedUrl', {str}),
|
||||
}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue