[generic] Support embedded Dailymotion playlists (fixes #3822)
authorNaglis Jonaitis <njonaitis@gmail.com>
Thu, 2 Oct 2014 18:42:45 +0000 (21:42 +0300)
committerNaglis Jonaitis <njonaitis@gmail.com>
Thu, 2 Oct 2014 18:42:45 +0000 (21:42 +0300)
youtube_dl/extractor/generic.py

index 14c024e48fcde2ebd2cc07ca7be4142b03bb86d7..c16da70f1d50d3fd5729071fe1599c1b25da7885 100644 (file)
@@ -639,6 +639,16 @@ class GenericIE(InfoExtractor):
             return _playlist_from_matches(
                 matches, lambda m: unescapeHTML(m[1]))
 
+        # Look for embedded Dailymotion playlist player (#3822)
+        m = re.search(
+            r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?dailymotion\.[a-z]{2,3}/widget/jukebox\?.+?)\1', webpage)
+        if m:
+            playlists = re.findall(
+                r'list\[\]=/playlist/([^/]+)/', unescapeHTML(m.group('url')))
+            if playlists:
+                return _playlist_from_matches(
+                    playlists, lambda p: '//dailymotion.com/playlist/%s' % p)
+
         # Look for embedded Wistia player
         match = re.search(
             r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:fast\.)?wistia\.net/embed/iframe/.+?)\1', webpage)