From c7fb478d21e9e59524befbe23f7801bb267fb880 Mon Sep 17 00:00:00 2001 From: gamer191 <83270075+gamer191@users.noreply.github.com> Date: Wed, 16 Sep 2026 07:48:51 +0000 Subject: [PATCH] [ie/youtube] Use Safari UA for web_embedded client (#17684) Authored by: gamer191 --- yt_dlp/extractor/youtube/_base.py | 1 + yt_dlp/extractor/youtube/_video.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/youtube/_base.py b/yt_dlp/extractor/youtube/_base.py index c68996eeca..e575ce9562 100644 --- a/yt_dlp/extractor/youtube/_base.py +++ b/yt_dlp/extractor/youtube/_base.py @@ -125,6 +125,7 @@ INNERTUBE_CLIENTS = { 'client': { 'clientName': 'WEB_EMBEDDED_PLAYER', 'clientVersion': '2.20260708.00.00', + 'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15,gzip(gfe)', }, }, 'INNERTUBE_CONTEXT_CLIENT_NAME': 56, diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index 290c3e4bde..3f9ebe0e71 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -3640,7 +3640,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): f['source_preference'] = -1 # Deprioritize since its pre-merged m3u8 formats may have lower quality audio streams - if client_name == 'web_safari' and proto == 'hls' and live_status != 'is_live': + if client_name in ('web_safari', 'web_embedded') and proto == 'hls' and live_status != 'is_live': f['source_preference'] -= 1 if missing_pot: