1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-27 21:46:54 +01:00

[youtube] Send the list of patterns directly to _search_regex

This commit is contained in:
Lukáš Lalinský 2015-11-22 13:53:26 +01:00
parent 0e49d9a6b0
commit b41631c4e6

View File

@ -879,10 +879,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
r';ytplayer\.config\s*=\s*({.*?});ytplayer', r';ytplayer\.config\s*=\s*({.*?});ytplayer',
r';ytplayer\.config\s*=\s*({.*?});', r';ytplayer\.config\s*=\s*({.*?});',
] ]
for pattern in patterns: config = self._search_regex(patterns, webpage, 'ytconfig.player', default=None)
config = self._search_regex(pattern, webpage, 'ytconfig.player', default=None) if config is not None:
if config is not None: return json.loads(uppercase_escape(config))
return json.loads(uppercase_escape(config))
def _get_automatic_captions(self, video_id, webpage): def _get_automatic_captions(self, video_id, webpage):
"""We need the webpage for getting the captions url, pass it as an """We need the webpage for getting the captions url, pass it as an