[udemy] Fix outputs' formats format_id
[youtube-dl] / youtube_dl / extractor / udemy.py
index da2d542ec5033d1a776f82c884856f019f7bf5f9..89e7132858e765aa60d801b87c2d85ce6cb755a7 100644 (file)
@@ -201,7 +201,7 @@ class UdemyIE(InfoExtractor):
         def extract_output_format(src):
             return {
                 'url': src['url'],
-                'format_id': '%sp' % (src.get('label') or format_id),
+                'format_id': '%sp' % (src.get('height') or format_id),
                 'width': int_or_none(src.get('width')),
                 'height': int_or_none(src.get('height')),
                 'vbr': int_or_none(src.get('video_bitrate_in_kbps')),
@@ -279,7 +279,7 @@ class UdemyIE(InfoExtractor):
                         'height': height,
                     })
 
-        self._sort_formats(formats)
+        self._sort_formats(formats, field_preference=('height', 'width', 'tbr', 'format_id'))
 
         return {
             'id': video_id,