]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[vimeo:review] Fix config URL extraction (closes #11821)
authorSergey M․ <dstftw@gmail.com>
Tue, 24 Jan 2017 15:46:40 +0000 (22:46 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 24 Jan 2017 15:46:40 +0000 (22:46 +0700)
youtube_dl/extractor/vimeo.py

index a6bbd4c052b2af2245d82c818702f2f1d9ed8de3..c12eeadd423de196de23aa0cc3a79bfcd1dd1a7c 100644 (file)
@@ -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(