diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-10-18 11:44:57 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-10-18 11:44:57 +0200 |
commit | 53c1d3ef4992c7682e56819e0a4079d7bbd9d44a (patch) | |
tree | 676f466f5a079577aad21de8807a73b73d2a55c2 /youtube_dl/extractor | |
parent | 8e55e9abfc4aec5369161e05789b3eacf1865246 (diff) |
Check for embedded YouTube player (Fixes #1616)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/generic.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 89805250c..69e0a7bd2 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -142,12 +142,19 @@ class GenericIE(InfoExtractor): # Look for embedded Vimeo player mobj = re.search( - r'<iframe\s+src="(https?://player.vimeo.com/video/.*?)"', webpage) + r'<iframe[^>]+?src="(https?://player.vimeo.com/video/.+?)"', webpage) if mobj: player_url = unescapeHTML(mobj.group(1)) surl = smuggle_url(player_url, {'Referer': url}) 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 mobj = re.search(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage) if mobj is None: |