From da9490259a61150752b538c0f58536d7f70b81ca Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sat, 14 Sep 2024 13:12:28 +1200 Subject: [PATCH] Fix default clients when using oauth --- yt_dlp/extractor/youtube.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 582138bd1..5d803f429 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -1513,6 +1513,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): } _SUBTITLE_FORMATS = ('json3', 'srv1', 'srv2', 'srv3', 'ttml', 'vtt') _DEFAULT_CLIENTS = ('ios', 'web_creator') + _DEFAULT_CLIENTS_OAUTH = ('ios', 'mweb') _GEO_BYPASS = False @@ -3979,9 +3980,10 @@ def _get_requested_clients(self, url, smuggled_data): allowed_clients = sorted( (client for client in INNERTUBE_CLIENTS if client[:1] != '_'), key=lambda client: INNERTUBE_CLIENTS[client]['priority'], reverse=True) + default_clients = self._DEFAULT_CLIENTS if not self._OAUTH_USER else self._DEFAULT_CLIENTS_OAUTH for client in self._configuration_arg('player_client'): if client == 'default': - requested_clients.extend(self._DEFAULT_CLIENTS) + requested_clients.extend(default_clients) elif client == 'all': requested_clients.extend(allowed_clients) elif client.startswith('-'): @@ -3991,7 +3993,7 @@ def _get_requested_clients(self, url, smuggled_data): else: requested_clients.append(client) if not requested_clients: - requested_clients.extend(self._DEFAULT_CLIENTS) + requested_clients.extend(default_clients) for excluded_client in excluded_clients: if excluded_client in requested_clients: requested_clients.remove(excluded_client)