aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/youtube.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-07-26 03:25:53 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-07-26 03:38:18 +0530
commitb4c055bac29a41e5fb8c4b6f2028d66bc7cf27f3 (patch)
tree2d7651a56225104ef5f9fda833fe8e586578799d /yt_dlp/extractor/youtube.py
parentea05b3020d11ae102d3b66853235ea7eacce465b (diff)
downloadhypervideo-pre-b4c055bac29a41e5fb8c4b6f2028d66bc7cf27f3.tar.lz
hypervideo-pre-b4c055bac29a41e5fb8c4b6f2028d66bc7cf27f3.tar.xz
hypervideo-pre-b4c055bac29a41e5fb8c4b6f2028d66bc7cf27f3.zip
[youtube] Add `player_client=all`
Diffstat (limited to 'yt_dlp/extractor/youtube.py')
-rw-r--r--yt_dlp/extractor/youtube.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 385ba34f9..fe0e7f38d 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -451,10 +451,6 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
# clients starting with _ cannot be explicity requested by the user
_YT_CLIENTS = {
- 'web': 'WEB',
- 'web_music': 'WEB_REMIX',
- '_web_embedded': 'WEB_EMBEDDED_PLAYER',
- '_web_agegate': 'TVHTML5',
'android': 'ANDROID',
'android_music': 'ANDROID_MUSIC',
'_android_embedded': 'ANDROID_EMBEDDED_PLAYER',
@@ -462,7 +458,11 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
'ios': 'IOS',
'ios_music': 'IOS_MUSIC',
'_ios_embedded': 'IOS_MESSAGES_EXTENSION',
- '_ios_agegate': 'IOS'
+ '_ios_agegate': 'IOS',
+ 'web': 'WEB',
+ 'web_music': 'WEB_REMIX',
+ '_web_embedded': 'WEB_EMBEDDED_PLAYER',
+ '_web_agegate': 'TVHTML5',
}
def _get_default_ytcfg(self, client='WEB'):
@@ -2430,8 +2430,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
identity_token, player_url, initial_pr)
def _get_requested_clients(self, url, smuggled_data):
- requested_clients = [client for client in self._configuration_arg('player_client')
- if client[:0] != '_' and client in self._YT_CLIENTS]
+ requested_clients = []
+ allowed_clients = [client for client in self._YT_CLIENTS.keys() if client[:1] != '_']
+ for client in self._configuration_arg('player_client'):
+ if client in allowed_clients:
+ requested_clients.append(client)
+ elif client == 'all':
+ requested_clients.extend(allowed_clients)
+ else:
+ self.report_warning(f'Skipping unsupported client {client}')
if not requested_clients:
requested_clients = ['android', 'web']