diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-08 21:03:13 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-08 21:22:35 +0530 |
commit | 4bb6b02f93e633dbba7bb722c167bf3b725cd7ce (patch) | |
tree | 83b9b4b43e190fca8ae792f29422568cfd87c8e0 /yt_dlp/extractor/youtube.py | |
parent | b5ac45b1971b39c2dc7296601516c68e7747e228 (diff) | |
download | hypervideo-pre-4bb6b02f93e633dbba7bb722c167bf3b725cd7ce.tar.lz hypervideo-pre-4bb6b02f93e633dbba7bb722c167bf3b725cd7ce.tar.xz hypervideo-pre-4bb6b02f93e633dbba7bb722c167bf3b725cd7ce.zip |
Improve `extractor_args` parsing
Diffstat (limited to 'yt_dlp/extractor/youtube.py')
-rw-r--r-- | yt_dlp/extractor/youtube.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 1233cc399..de70fcdd3 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2207,11 +2207,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor): player_url = self._extract_player_url(ytcfg, webpage) - player_client = try_get(self._configuration_arg('player_client'), lambda x: x[0], str) or '' - if player_client.upper() not in ('WEB', 'ANDROID'): - player_client = 'WEB' - force_mobile_client = player_client.upper() == 'ANDROID' - player_skip = self._configuration_arg('player_skip') or [] + player_client = (self._configuration_arg('player_client') or [''])[0] + if player_client not in ('web', 'android', ''): + self.report_warning(f'Invalid player_client {player_client} given. Falling back to WEB') + force_mobile_client = player_client == 'android' + player_skip = self._configuration_arg('player_skip') def get_text(x): if not x: @@ -2489,7 +2489,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): dct['container'] = dct['ext'] + '_dash' formats.append(dct) - skip_manifests = self._configuration_arg('skip') or [] + skip_manifests = self._configuration_arg('skip') get_dash = 'dash' not in skip_manifests and self.get_param('youtube_include_dash_manifest', True) get_hls = 'hls' not in skip_manifests and self.get_param('youtube_include_hls_manifest', True) |