1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-01-31 04:22:25 +01:00

[ie/youtube] Download tv client Innertube config (#12168)

Authored by: coletdjnz
This commit is contained in:
coletdjnz 2025-01-23 18:26:02 +13:00 committed by GitHub
parent ccda63934d
commit 326fb1ffaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -271,7 +271,8 @@ INNERTUBE_CLIENTS = {
'INNERTUBE_CONTEXT': {
'client': {
'clientName': 'TVHTML5',
'clientVersion': '7.20241201.18.00',
'clientVersion': '7.20250120.19.00',
'userAgent': 'Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version',
},
},
'INNERTUBE_CONTEXT_CLIENT_NAME': 7,
@ -853,11 +854,15 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
'web': 'https://www.youtube.com',
'web_music': 'https://music.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 {}
webpage = self._download_webpage(
url, video_id, fatal=False, note=f'Downloading {client.replace("_", " ").strip()} client config')
url, video_id, fatal=False, note=f'Downloading {client.replace("_", " ").strip()} client config',
headers=traverse_obj(self._get_default_ytcfg(client), {
'User-Agent': ('INNERTUBE_CONTEXT', 'client', 'userAgent', {str}),
}))
return self.extract_ytcfg(video_id, webpage) or {}
@staticmethod