]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
YoutubePlaylistIE: try to extract the url of the entries from the media$group dictionary
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 14 Jun 2013 12:14:02 +0000 (14:14 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Thu, 20 Jun 2013 15:23:27 +0000 (17:23 +0200)
Extracting it from content can return rtsp urls.

youtube_dl/InfoExtractors.py

index d9c555643dc7ac4e4421f857d494d88e8aeb9183..418c23f748de3a33f21bb2ad251dcf9ff190d36c 100755 (executable)
@@ -1606,9 +1606,15 @@ class YoutubePlaylistIE(InfoExtractor):
                 # Number of videos is a multiple of self._MAX_RESULTS
                 break
 
-            videos += [ (entry['yt$position']['$t'], entry['content']['src'])
-                        for entry in response['feed']['entry']
-                        if 'content' in entry ]
+            for entry in response['feed']['entry']:
+                index = entry['yt$position']['$t']
+                if 'media$group' in entry and 'media$player' in entry['media$group']:
+                    videos.append((index, entry['media$group']['media$player']['url']))
+                # Using this field can cause problems:
+                # https://github.com/rg3/youtube-dl/issues/886
+                elif 'content' in entry:
+                    videos.append((index, entry['content']['src']))
+
 
             if len(response['feed']['entry']) < self._MAX_RESULTS:
                 break