From ecab2407715f2c90740ac50eb737092fc5f3d190 Mon Sep 17 00:00:00 2001 From: Haxy Date: Thu, 28 Mar 2024 00:13:07 +0000 Subject: [PATCH] Add YouTube client that can access 1080p non split streams --- yt_dlp/extractor/youtube.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 589cd9b595..5bcb238e46 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -238,6 +238,16 @@ }, 'INNERTUBE_CONTEXT_CLIENT_NAME': 85 }, + # This client has 1080p non split stream videos + 'media_connect_frontend': { + 'INNERTUBE_CONTEXT': { + 'client': { + 'clientName': 'MEDIA_CONNECT_FRONTEND', + 'clientVersion': '0.1', + }, + }, + 'INNERTUBE_CONTEXT_CLIENT_NAME': 95 + }, } @@ -258,7 +268,7 @@ def build_innertube_clients(): THIRD_PARTY = { 'embedUrl': 'https://www.youtube.com/', # Can be any valid URL } - BASE_CLIENTS = ('ios', 'android', 'web', 'tv', 'mweb') + BASE_CLIENTS = ('ios', 'android', 'web', 'tv', 'mweb', 'media_connect_frontend') priority = qualities(BASE_CLIENTS[::-1]) for client, ytcfg in tuple(INNERTUBE_CLIENTS.items()): @@ -3619,7 +3629,7 @@ def _extract_player_response(self, client, video_id, master_ytcfg, player_ytcfg, def _get_requested_clients(self, url, smuggled_data): requested_clients = [] - default = ['ios', 'android', 'web'] + default = ['ios', 'android', 'web', 'media_connect_frontend'] allowed_clients = sorted( (client for client in INNERTUBE_CLIENTS.keys() if client[:1] != '_'), key=lambda client: INNERTUBE_CLIENTS[client]['priority'], reverse=True)