Generic/VimeoIE: Return a playlist of all vimeo iframes/embeds (try2)
Vimeo extraction logic is restricted to the first video only, even if a page has multiple videos: youtube-dl http://www.theguardian.com/environment/2015/jun/10/climate-change-has-left-us-exposed-in-arctic-say-military-experts --get-title WARNING: Falling back on generic information extractor. The Climate 25: Sherri Goodman After patch: youtube-dl http://www.theguardian.com/environment/2015/jun/10/climate-change-has-left-us-exposed-in-arctic-say-military-experts --get-title WARNING: Falling back on generic information extractor. The Climate 25: Sherri Goodman The Climate 25: David Titley The Climate 25: Steve Cheney The Climate 25: General Charles Jacoby The Climate 25: Henry Paulson
This commit is contained in:
parent
255f5694aa
commit
073741b132
@ -1124,9 +1124,9 @@ class GenericIE(InfoExtractor):
|
|||||||
if matches:
|
if matches:
|
||||||
return _playlist_from_matches(matches, ie='RtlNl')
|
return _playlist_from_matches(matches, ie='RtlNl')
|
||||||
|
|
||||||
vimeo_url = VimeoIE._extract_vimeo_url(url, webpage)
|
vimeo_urls = VimeoIE._extract_vimeo_urls(url, webpage)
|
||||||
if vimeo_url is not None:
|
if vimeo_urls is not None:
|
||||||
return self.url_result(vimeo_url)
|
return _playlist_from_matches(vimeo_urls, ie='Vimeo')
|
||||||
|
|
||||||
# Look for embedded YouTube player
|
# Look for embedded YouTube player
|
||||||
matches = re.findall(r'''(?x)
|
matches = re.findall(r'''(?x)
|
||||||
|
@ -175,19 +175,15 @@ class VimeoIE(VimeoBaseInfoExtractor):
|
|||||||
]
|
]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_vimeo_url(url, webpage):
|
def _extract_vimeo_urls(url, webpage):
|
||||||
# Look for embedded (iframe) Vimeo player
|
# Look for embedded (iframe) Vimeo player
|
||||||
mobj = re.search(
|
mobj = re.findall(
|
||||||
r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//player\.vimeo\.com/video/.+?)\1', webpage)
|
r'<(?:iframe|embed)[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:player\.vimeo\.com/video/|(?:www\.)?vimeo\.com/moogaloop\.swf).+?)\1', webpage)
|
||||||
if mobj:
|
if mobj:
|
||||||
player_url = unescapeHTML(mobj.group('url'))
|
return map(
|
||||||
surl = smuggle_url(player_url, {'Referer': url})
|
lambda m: smuggle_url(unescapeHTML(m[1]), {'Referer': url}),
|
||||||
return surl
|
mobj
|
||||||
# Look for embedded (swf embed) Vimeo player
|
)
|
||||||
mobj = re.search(
|
|
||||||
r'<embed[^>]+?src="((?:https?:)?//(?:www\.)?vimeo\.com/moogaloop\.swf.+?)"', webpage)
|
|
||||||
if mobj:
|
|
||||||
return mobj.group(1)
|
|
||||||
|
|
||||||
def _verify_video_password(self, url, video_id, webpage):
|
def _verify_video_password(self, url, video_id, webpage):
|
||||||
password = self._downloader.params.get('videopassword', None)
|
password = self._downloader.params.get('videopassword', None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user