]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[youtube] Playlists: extract the videos id from ['media$group']['yt$videoid'] (fixes...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Thu, 5 Sep 2013 19:40:04 +0000 (21:40 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Thu, 5 Sep 2013 19:40:04 +0000 (21:40 +0200)
'media$player' is not defined for private videos.

youtube_dl/extractor/youtube.py

index 01265ca2878b4f6bff0a9f0cddfe8fcdf00e3ecf..782cb1cfb5e596797e8e27da9b69ef87c5b9cee6 100644 (file)
@@ -943,8 +943,11 @@ class YoutubePlaylistIE(InfoExtractor):
 
             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']))
+                if 'media$group' in entry and 'yt$videoid' in entry['media$group']:
+                    videos.append((
+                        index,
+                        'https://www.youtube.com/watch?v=' + entry['media$group']['yt$videoid']['$t']
+                    ))
 
         videos = [v[1] for v in sorted(videos)]