mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-28 11:36:22 +00:00
[ie/youtube] Skip clients that don't support cookies when authenticated
Authored by: bashonly
This commit is contained in:
parent
2808973c47
commit
61be30e749
@ -3862,9 +3862,18 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
_, base_client, variant = _split_innertube_client(requested_client)
|
_, base_client, variant = _split_innertube_client(requested_client)
|
||||||
music_client = f'{base_client}_music' if base_client != 'mweb' else 'web_music'
|
music_client = f'{base_client}_music' if base_client != 'mweb' else 'web_music'
|
||||||
if variant != 'music' and music_client in INNERTUBE_CLIENTS:
|
if variant != 'music' and music_client in INNERTUBE_CLIENTS:
|
||||||
if not INNERTUBE_CLIENTS[music_client]['REQUIRE_AUTH'] or self.is_authenticated:
|
client_info = INNERTUBE_CLIENTS[music_client]
|
||||||
|
if not client_info['REQUIRE_AUTH'] or (self.is_authenticated and client_info['SUPPORTS_COOKIES']):
|
||||||
requested_clients.append(music_client)
|
requested_clients.append(music_client)
|
||||||
|
|
||||||
|
if self.is_authenticated:
|
||||||
|
unsupported_clients = [
|
||||||
|
client for client in requested_clients if not INNERTUBE_CLIENTS[client]['SUPPORTS_COOKIES']
|
||||||
|
]
|
||||||
|
for client in unsupported_clients:
|
||||||
|
self.report_warning(f'Skipping client "{client}" since it does not support cookies', only_once=True)
|
||||||
|
requested_clients.remove(client)
|
||||||
|
|
||||||
return orderedSet(requested_clients)
|
return orderedSet(requested_clients)
|
||||||
|
|
||||||
def _invalid_player_response(self, pr, video_id):
|
def _invalid_player_response(self, pr, video_id):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user