Browse Source

[vimeo] Add support for review pages

Since the regexp is already overboarding and review pages have a distinct URL format (with non-trivial stuff after the ID), use a dedicated IE.
Fixes #2106
totalwebcasting
Philipp Hagemeister 11 years ago
parent
commit
fcea44c6d5
2 changed files with 24 additions and 2 deletions
  1. +1
    -0
      youtube_dl/extractor/__init__.py
  2. +23
    -2
      youtube_dl/extractor/vimeo.py

+ 1
- 0
youtube_dl/extractor/__init__.py View File

@ -199,6 +199,7 @@ from .vimeo import (
VimeoUserIE, VimeoUserIE,
VimeoAlbumIE, VimeoAlbumIE,
VimeoGroupsIE, VimeoGroupsIE,
VimeoReviewIE,
) )
from .vine import VineIE from .vine import VineIE
from .viki import VikiIE from .viki import VikiIE


+ 23
- 2
youtube_dl/extractor/vimeo.py View File

@ -311,7 +311,7 @@ class VimeoChannelIE(InfoExtractor):
class VimeoUserIE(VimeoChannelIE): class VimeoUserIE(VimeoChannelIE):
IE_NAME = u'vimeo:user' IE_NAME = u'vimeo:user'
_VALID_URL = r'(?:https?://)?vimeo.\com/(?P<name>[^/]+)'
_VALID_URL = r'(?:https?://)?vimeo.\com/(?P<name>[^/]+)(?:[#?]|$)'
_TITLE_RE = r'<a[^>]+?class="user">([^<>]+?)</a>' _TITLE_RE = r'<a[^>]+?class="user">([^<>]+?)</a>'
@classmethod @classmethod
@ -336,7 +336,7 @@ class VimeoAlbumIE(VimeoChannelIE):
def _real_extract(self, url): def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)
album_id = mobj.group('id')
album_id = mobj.group('id')
return self._extract_videos(album_id, 'http://vimeo.com/album/%s' % album_id) return self._extract_videos(album_id, 'http://vimeo.com/album/%s' % album_id)
@ -351,3 +351,24 @@ class VimeoGroupsIE(VimeoAlbumIE):
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)
name = mobj.group('name') name = mobj.group('name')
return self._extract_videos(name, 'http://vimeo.com/groups/%s' % name) return self._extract_videos(name, 'http://vimeo.com/groups/%s' % name)
class VimeoReviewIE(InfoExtractor):
IE_NAME = u'vimeo:review'
IE_DESC = u'Review pages on vimeo'
_VALID_URL = r'(?:https?://)?vimeo.\com/[^/]+/review/(?P<id>[^/]+)'
_TEST = {
'url': 'https://vimeo.com/user21297594/review/75524534/3c257a1b5d',
'file': '75524534.mp4',
'md5': 'c507a72f780cacc12b2248bb4006d253',
'info_dict': {
'title': "DICK HARDWICK 'Comedian'",
'uploader': 'Richard Hardwick',
}
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
player_url = 'https://player.vimeo.com/player/' + video_id
return self.url_result(player_url, 'Vimeo', video_id)

Loading…
Cancel
Save