From: Lukáš Lalinský Date: Sun, 22 Nov 2015 12:53:26 +0000 (+0100) Subject: [youtube] Send the list of patterns directly to _search_regex X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=b41631c4e6e56afb2427513c84df1b13681cf4c8;p=youtube-dl [youtube] Send the list of patterns directly to _search_regex --- diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 7e74d2368..247769067 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -879,10 +879,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor): r';ytplayer\.config\s*=\s*({.*?});ytplayer', r';ytplayer\.config\s*=\s*({.*?});', ] - for pattern in patterns: - config = self._search_regex(pattern, webpage, 'ytconfig.player', default=None) - if config is not None: - return json.loads(uppercase_escape(config)) + config = self._search_regex(patterns, webpage, 'ytconfig.player', default=None) + if config is not None: + return json.loads(uppercase_escape(config)) def _get_automatic_captions(self, video_id, webpage): """We need the webpage for getting the captions url, pass it as an