[ie/youtube] Fix web_embedded player client (#16177)

Closes #16077
Authored by: SparseOrnament15, bashonly

Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
SparseOrnament15
2026-03-10 23:25:13 +00:00
committed by GitHub
co-authored by bashonly
parent 7e145ac1ca
commit f2bd3202c0
2 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -368,7 +368,7 @@ def short_client_name(client_name):
def _fix_embedded_ytcfg(ytcfg):
ytcfg['INNERTUBE_CONTEXT'].setdefault('thirdParty', {}).update({
'embedUrl': 'https://www.youtube.com/', # Can be any valid URL
'embedUrl': 'https://www.reddit.com/', # Can be any valid non-YouTube URL
})
@@ -967,6 +967,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
url, video_id, note=f'Downloading {client.replace("_", " ").strip()} client config',
headers=traverse_obj(self._get_default_ytcfg(client), {
'User-Agent': ('INNERTUBE_CONTEXT', 'client', 'userAgent', {str}),
'Referer': ('INNERTUBE_CONTEXT', 'thirdParty', 'embedUrl', {str}),
}))
ytcfg = self.extract_ytcfg(video_id, webpage) or {}