diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-06-21 18:23:58 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-06-21 18:23:58 +0800 |
commit | b407e173e44041b1a92fb61e316f92d19834a40a (patch) | |
tree | f1411905b0dc6b90e0020cb9061b1b17d6cd1bf8 /youtube_dl/extractor/generic.py | |
parent | 6a745c2c0fa2d627b46f2d4d8013fa69276c4fac (diff) |
[vimeo/generic] Move detection logic from GenericIE to VimeoIE
Diffstat (limited to 'youtube_dl/extractor/generic.py')
-rw-r--r-- | youtube_dl/extractor/generic.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index f6b984300..bf689f531 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -43,6 +43,7 @@ from .senateisvp import SenateISVPIE from .bliptv import BlipTVIE from .svt import SVTIE from .pornhub import PornHubIE +from .vimeo import VimeoIE class GenericIE(InfoExtractor): @@ -1089,18 +1090,9 @@ class GenericIE(InfoExtractor): if matches: return _playlist_from_matches(matches, ie='RtlNl') - # Look for embedded (iframe) Vimeo player - mobj = re.search( - r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//player\.vimeo\.com/video/.+?)\1', webpage) - if mobj: - player_url = unescapeHTML(mobj.group('url')) - surl = smuggle_url(player_url, {'Referer': url}) - return self.url_result(surl) - # 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_url = VimeoIE._extract_vimeo_url(url, webpage) + if vimeo_url is not None: + return self.url_result(vimeo_url) # Look for embedded YouTube player matches = re.findall(r'''(?x) |