1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-25 18:03:01 +08:00

[vimeo/generic] Add support for embedded SWF vimeo videos

This commit is contained in:
Philipp Hagemeister 2013-12-22 03:34:13 +01:00
parent 04ff34ab89
commit 7115ca84aa
2 changed files with 9 additions and 3 deletions

View File

@ -222,7 +222,7 @@ class GenericIE(InfoExtractor):
self.to_screen(u'Brightcove video detected.') self.to_screen(u'Brightcove video detected.')
return self.url_result(bc_url, 'Brightcove') return self.url_result(bc_url, 'Brightcove')
# Look for embedded Vimeo player # Look for embedded (iframe) Vimeo player
mobj = re.search( mobj = re.search(
r'<iframe[^>]+?src="(https?://player.vimeo.com/video/.+?)"', webpage) r'<iframe[^>]+?src="(https?://player.vimeo.com/video/.+?)"', webpage)
if mobj: if mobj:
@ -230,6 +230,12 @@ class GenericIE(InfoExtractor):
surl = smuggle_url(player_url, {'Referer': url}) surl = smuggle_url(player_url, {'Referer': url})
return self.url_result(surl, 'Vimeo') return self.url_result(surl, 'Vimeo')
# Look for embedded (swf embed) Vimeo player
mobj = re.search(
r'<embed[^>]+?src="(https?://(?:www\.)?vimeo.com/moogaloop.swf.+?)"', webpage)
if mobj:
return self.url_result(mobj.group(1), 'Vimeo')
# Look for embedded YouTube player # Look for embedded YouTube player
matches = re.findall(r'''(?x) matches = re.findall(r'''(?x)
(?:<iframe[^>]+?src=|embedSWF\(\s*) (?:<iframe[^>]+?src=|embedSWF\(\s*)

View File

@ -26,10 +26,10 @@ class VimeoIE(InfoExtractor):
(?:(?:www|(?P<player>player))\.)? (?:(?:www|(?P<player>player))\.)?
vimeo(?P<pro>pro)?\.com/ vimeo(?P<pro>pro)?\.com/
(?:.*?/)? (?:.*?/)?
(?P<direct_link>play_redirect_hls\?clip_id=)? (?:(?:play_redirect_hls|moogaloop\.swf)\?clip_id=)?
(?:videos?/)? (?:videos?/)?
(?P<id>[0-9]+) (?P<id>[0-9]+)
/?(?:[?].*)?(?:[#].*)?$''' /?(?:[?&].*)?(?:[#].*)?$'''
_NETRC_MACHINE = 'vimeo' _NETRC_MACHINE = 'vimeo'
IE_NAME = u'vimeo' IE_NAME = u'vimeo'
_TESTS = [ _TESTS = [