mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-16 10:50:51 +00:00
Check for embedded YouTube player (Fixes #1616)
This commit is contained in:
parent
8e55e9abfc
commit
53c1d3ef49
@ -142,12 +142,19 @@ class GenericIE(InfoExtractor):
|
|||||||
|
|
||||||
# Look for embedded Vimeo player
|
# Look for embedded Vimeo player
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'<iframe\s+src="(https?://player.vimeo.com/video/.*?)"', webpage)
|
r'<iframe[^>]+?src="(https?://player.vimeo.com/video/.+?)"', webpage)
|
||||||
if mobj:
|
if mobj:
|
||||||
player_url = unescapeHTML(mobj.group(1))
|
player_url = unescapeHTML(mobj.group(1))
|
||||||
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 YouTube player
|
||||||
|
mobj = re.search(
|
||||||
|
r'<iframe[^>]+?src="(https?://(?:www\.)?youtube.com/embed/.+?)"', webpage)
|
||||||
|
if mobj:
|
||||||
|
surl = unescapeHTML(mobj.group(1))
|
||||||
|
return self.url_result(surl, 'Youtube')
|
||||||
|
|
||||||
# Start with something easy: JW Player in SWFObject
|
# Start with something easy: JW Player in SWFObject
|
||||||
mobj = re.search(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage)
|
mobj = re.search(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage)
|
||||||
if mobj is None:
|
if mobj is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user