diff options
| author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-10-23 14:38:03 +0200 | 
|---|---|---|
| committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-10-23 14:38:03 +0200 | 
| commit | 55b3e45bbab3af5132d45c8f3f8f19fae5f5f1d9 (patch) | |
| tree | 66ee276615c7e93408ae55e7cb9235fb3bb34817 /youtube_dl/extractor/vimeo.py | |
| parent | 365bcf6d975281ad769200cc8616872d0b6d6607 (diff) | |
[vimeo] Fix pro videos and player.vimeo.com urls
The old process can still be used for those videos.
Added RegexNotFoundError, which is raised by _search_regex if it can't extract the info.
Diffstat (limited to 'youtube_dl/extractor/vimeo.py')
| -rw-r--r-- | youtube_dl/extractor/vimeo.py | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index bf48671b3..ad2f75d6b 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -10,6 +10,7 @@ from ..utils import (      clean_html,      get_element_by_attribute,      ExtractorError, +    RegexNotFoundError,      std_headers,      unsmuggle_url,  ) @@ -133,6 +134,11 @@ class VimeoIE(InfoExtractor):                  r' data-config-url="(.+?)"', webpage, u'config URL')              config_json = self._download_webpage(config_url, video_id)              config = json.loads(config_json) +        except RegexNotFoundError: +            # For pro videos or player.vimeo.com urls +            config = self._search_regex([r' = {config:({.+?}),assets:', r'c=({.+?);'], +                webpage, u'info section', flags=re.DOTALL) +            config = json.loads(config)          except Exception as e:              if re.search('The creator of this video has not given you permission to embed it on this domain.', webpage):                  raise ExtractorError(u'The author has restricted the access to this video, try with the "--referer" option') | 
