[generic] Find embedded dailymotion videos (Fixes #1848)
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 1 Dec 2013 00:21:33 +0000 (01:21 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 1 Dec 2013 00:21:33 +0000 (01:21 +0100)
youtube_dl/extractor/generic.py

index 37671430a99b66dea8339dfd986503f3cb57f59e..10ae06263ef1349ff6526575feb61cb71591f3cc 100644 (file)
@@ -195,6 +195,15 @@ class GenericIE(InfoExtractor):
             return self.playlist_result(
                 urlrs, playlist_id=video_id, playlist_title=video_title)
 
+        # Look for embedded Dailymotion player
+        matches = re.findall(
+            r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?dailymotion.com/embed/video/.+?)\1', webpage)
+        if matches:
+            urlrs = [self.url_result(unescapeHTML(tuppl[1]), 'Dailymotion')
+                     for tuppl in matches]
+            return self.playlist_result(
+                urlrs, playlist_id=video_id, playlist_title=video_title)
+
         # Look for Bandcamp pages with custom domain
         mobj = re.search(r'<meta property="og:url"[^>]*?content="(.*?bandcamp\.com.*?)"', webpage)
         if mobj is not None: