From 7115ca84aacf8eca3016c9a27cb6411ae5f52305 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 22 Dec 2013 03:34:13 +0100 Subject: [PATCH] [vimeo/generic] Add support for embedded SWF vimeo videos --- youtube_dl/extractor/generic.py | 8 +++++++- youtube_dl/extractor/vimeo.py | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index bdb4f58d6..7a14c98f9 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -222,7 +222,7 @@ class GenericIE(InfoExtractor): self.to_screen(u'Brightcove video detected.') return self.url_result(bc_url, 'Brightcove') - # Look for embedded Vimeo player + # Look for embedded (iframe) Vimeo player mobj = re.search( r']+?src="(https?://player.vimeo.com/video/.+?)"', webpage) if mobj: @@ -230,6 +230,12 @@ class GenericIE(InfoExtractor): surl = smuggle_url(player_url, {'Referer': url}) return self.url_result(surl, 'Vimeo') + # Look for embedded (swf embed) Vimeo player + mobj = re.search( + r']+?src="(https?://(?:www\.)?vimeo.com/moogaloop.swf.+?)"', webpage) + if mobj: + return self.url_result(mobj.group(1), 'Vimeo') + # Look for embedded YouTube player matches = re.findall(r'''(?x) (?:]+?src=|embedSWF\(\s*) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 4e8fef165..c3623fcbe 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -26,10 +26,10 @@ class VimeoIE(InfoExtractor): (?:(?:www|(?Pplayer))\.)? vimeo(?Ppro)?\.com/ (?:.*?/)? - (?Pplay_redirect_hls\?clip_id=)? + (?:(?:play_redirect_hls|moogaloop\.swf)\?clip_id=)? (?:videos?/)? (?P[0-9]+) - /?(?:[?].*)?(?:[#].*)?$''' + /?(?:[?&].*)?(?:[#].*)?$''' _NETRC_MACHINE = 'vimeo' IE_NAME = u'vimeo' _TESTS = [ -- 2.22.2