diff options
author | coletdjnz <coletdjnz@protonmail.com> | 2025-01-23 18:26:02 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-23 18:26:02 +1300 |
commit | 326fb1ffaf4e8349f1fe8ba2a81839652e044bff (patch) | |
tree | 4510c3c99f2945599a0a7984ccde04bf9565a95a | |
parent | ccda63934df7de2823f0834218c4254c7c4d2e4c (diff) |
[ie/youtube] Download `tv` client Innertube config (#12168)
Authored by: coletdjnz
-rw-r--r-- | yt_dlp/extractor/youtube.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index c23e65cc5..5ac49ff72 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -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 |