|
|
@ -20,7 +20,7 @@ class VimeoIE(InfoExtractor):
|
|
|
|
"""Information extractor for vimeo.com."""
|
|
|
|
"""Information extractor for vimeo.com."""
|
|
|
|
|
|
|
|
|
|
|
|
# _VALID_URL matches Vimeo URLs
|
|
|
|
# _VALID_URL matches Vimeo URLs
|
|
|
|
_VALID_URL = r'(?P<proto>https?://)?(?:(?:www|player)\.)?vimeo(?P<pro>pro)?\.com/(?:(?:(?:groups|album)/[^/]+)|(?:.*?)/)?(?P<direct_link>play_redirect_hls\?clip_id=)?(?:videos?/)?(?P<id>[0-9]+)/?(?:[?].*)?(?:#.*)?$'
|
|
|
|
_VALID_URL = r'(?P<proto>https?://)?(?:(?:www|(?P<player>player))\.)?vimeo(?P<pro>pro)?\.com/(?:(?:(?:groups|album)/[^/]+)|(?:.*?)/)?(?P<direct_link>play_redirect_hls\?clip_id=)?(?:videos?/)?(?P<id>[0-9]+)/?(?:[?].*)?(?:#.*)?$'
|
|
|
|
_NETRC_MACHINE = 'vimeo'
|
|
|
|
_NETRC_MACHINE = 'vimeo'
|
|
|
|
IE_NAME = u'vimeo'
|
|
|
|
IE_NAME = u'vimeo'
|
|
|
|
_TESTS = [
|
|
|
|
_TESTS = [
|
|
|
@ -128,11 +128,9 @@ class VimeoIE(InfoExtractor):
|
|
|
|
raise ExtractorError(u'Invalid URL: %s' % url)
|
|
|
|
raise ExtractorError(u'Invalid URL: %s' % url)
|
|
|
|
|
|
|
|
|
|
|
|
video_id = mobj.group('id')
|
|
|
|
video_id = mobj.group('id')
|
|
|
|
if not mobj.group('proto'):
|
|
|
|
if mobj.group('pro') or mobj.group('player'):
|
|
|
|
url = 'https://' + url
|
|
|
|
|
|
|
|
elif mobj.group('pro'):
|
|
|
|
|
|
|
|
url = 'http://player.vimeo.com/video/' + video_id
|
|
|
|
url = 'http://player.vimeo.com/video/' + video_id
|
|
|
|
elif mobj.group('direct_link'):
|
|
|
|
else:
|
|
|
|
url = 'https://vimeo.com/' + video_id
|
|
|
|
url = 'https://vimeo.com/' + video_id
|
|
|
|
|
|
|
|
|
|
|
|
# Retrieve video webpage to extract further information
|
|
|
|
# Retrieve video webpage to extract further information
|
|
|
@ -234,7 +232,7 @@ class VimeoIE(InfoExtractor):
|
|
|
|
if len(formats) == 0:
|
|
|
|
if len(formats) == 0:
|
|
|
|
raise ExtractorError(u'No known codec found')
|
|
|
|
raise ExtractorError(u'No known codec found')
|
|
|
|
|
|
|
|
|
|
|
|
return [{
|
|
|
|
return {
|
|
|
|
'id': video_id,
|
|
|
|
'id': video_id,
|
|
|
|
'uploader': video_uploader,
|
|
|
|
'uploader': video_uploader,
|
|
|
|
'uploader_id': video_uploader_id,
|
|
|
|
'uploader_id': video_uploader_id,
|
|
|
@ -243,7 +241,8 @@ class VimeoIE(InfoExtractor):
|
|
|
|
'thumbnail': video_thumbnail,
|
|
|
|
'thumbnail': video_thumbnail,
|
|
|
|
'description': video_description,
|
|
|
|
'description': video_description,
|
|
|
|
'formats': formats,
|
|
|
|
'formats': formats,
|
|
|
|
}]
|
|
|
|
'webpage_url': url,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VimeoChannelIE(InfoExtractor):
|
|
|
|
class VimeoChannelIE(InfoExtractor):
|
|
|
|