diff options
author | Sergey M․ <dstftw@gmail.com> | 2017-01-24 22:46:40 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2017-01-24 22:46:40 +0700 |
commit | d61aa5eb37244a04caa09f1f238a4f81366c109b (patch) | |
tree | f57275a1ccef06b5e44874c32486ce6c474186b3 /youtube_dl/extractor | |
parent | c3a65c3de0667b8de4af8fdc8c1eb04a1498e104 (diff) |
[vimeo:review] Fix config URL extraction (closes #11821)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/vimeo.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index a6bbd4c05..c12eeadd4 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -884,10 +884,14 @@ class VimeoReviewIE(VimeoBaseInfoExtractor): def _get_config_url(self, webpage_url, video_id, video_password_verified=False): webpage = self._download_webpage(webpage_url, video_id) - data = self._parse_json(self._search_regex( - r'window\s*=\s*_extend\(window,\s*({.+?})\);', webpage, 'data', - default=NO_DEFAULT if video_password_verified else '{}'), video_id) - config_url = data.get('vimeo_esi', {}).get('config', {}).get('configUrl') + config_url = self._html_search_regex( + r'data-config-url=(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, + 'config URL', default=None, group='url') + if not config_url: + data = self._parse_json(self._search_regex( + r'window\s*=\s*_extend\(window,\s*({.+?})\);', webpage, 'data', + default=NO_DEFAULT if video_password_verified else '{}'), video_id) + config_url = data.get('vimeo_esi', {}).get('config', {}).get('configUrl') if config_url is None: self._verify_video_password(webpage_url, video_id, webpage) config_url = self._get_config_url( |