[lynda] Extract all prioritized streams
authorSergey M․ <dstftw@gmail.com>
Sat, 17 Oct 2015 19:36:03 +0000 (01:36 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 17 Oct 2015 19:36:03 +0000 (01:36 +0600)
youtube_dl/extractor/lynda.py

index 378117270439e7ce2669c46422f3df63caa33051..5c973e75ccf630c71b50dcc590e93185f3a5c5ea 100644 (file)
@@ -140,13 +140,14 @@ class LyndaIE(LyndaBaseIE):
 
         prioritized_streams = video_json.get('PrioritizedStreams')
         if prioritized_streams:
-            formats.extend([
-                {
-                    'url': video_url,
-                    'width': int_or_none(format_id),
-                    'format_id': format_id,
-                } for format_id, video_url in prioritized_streams['0'].items()
-            ])
+            for prioritized_stream_id, prioritized_stream in prioritized_streams.items():
+                formats.extend([
+                    {
+                        'url': video_url,
+                        'width': int_or_none(format_id),
+                        'format_id': '%s-%s' % (prioritized_stream_id, format_id),
+                    } for format_id, video_url in prioritized_stream.items()
+                ])
 
         self._check_formats(formats, video_id)
         self._sort_formats(formats)