]> jfr.im git - yt-dlp.git/commitdiff
Fix some fields not sorting correctly
authorpukkandan <redacted>
Mon, 25 Jan 2021 13:58:39 +0000 (19:28 +0530)
committerpukkandan <redacted>
Mon, 25 Jan 2021 13:58:39 +0000 (19:28 +0530)
bug introduced by: 63be1aab2f6b6a99f289663ffd935e311aff5556

youtube_dlc/extractor/common.py

index d14517b546699f0e4cabb40e2c455442a44385fd..7b2f158e162de2f98f328c466f8917c410a5a19b 100644 (file)
@@ -1375,7 +1375,7 @@ class FormatSort:
                        'order': ['vp9', '(h265|he?vc?)', '(h264|avc)', 'vp8', '(mp4v|h263)', 'theora', '', None, 'none']},
             'acodec': {'type': 'ordered', 'regex': True,
                        'order': ['opus', 'vorbis', 'aac', 'mp?4a?', 'mp3', 'e?a?c-?3', 'dts', '', None, 'none']},
-            'proto': {'type': 'ordered', 'regex': True,
+            'proto': {'type': 'ordered', 'regex': True, 'field': 'protocol',
                       'order': ['(ht|f)tps', '(ht|f)tp$', 'm3u8.+', 'm3u8', '.*dash', '', 'mms|rtsp', 'none', 'f4']},
             'vext': {'type': 'ordered', 'field': 'video_ext',
                      'order': ('mp4', 'webm', 'flv', '', 'none'),
@@ -1384,14 +1384,14 @@ class FormatSort:
                      'order': ('m4a', 'aac', 'mp3', 'ogg', 'opus', 'webm', '', 'none'),
                      'order_free': ('opus', 'ogg', 'webm', 'm4a', 'mp3', 'aac', '', 'none')},
             'hidden': {'visible': False, 'forced': True, 'type': 'extractor', 'max': -1000},
-            'ie_pref': {'priority': True, 'type': 'extractor'},
+            'ie_pref': {'priority': True, 'type': 'extractor', 'field': 'extractor_preference'},
             'hasvid': {'priority': True, 'field': 'vcodec', 'type': 'boolean', 'not_in_list': ('none',)},
             'hasaud': {'field': 'acodec', 'type': 'boolean', 'not_in_list': ('none',)},
-            'lang': {'priority': True, 'convert': 'ignore'},
+            'lang': {'priority': True, 'convert': 'ignore', 'field': 'language_preference'},
             'quality': {'priority': True, 'convert': 'float_none'},
             'filesize': {'convert': 'bytes'},
-            'fs_approx': {'convert': 'bytes'},
-            'id': {'convert': 'string'},
+            'fs_approx': {'convert': 'bytes', 'field': 'filesize_approx'},
+            'id': {'convert': 'string', 'field': 'format_id'},
             'height': {'convert': 'float_none'},
             'width': {'convert': 'float_none'},
             'fps': {'convert': 'float_none'},
@@ -1399,7 +1399,7 @@ class FormatSort:
             'vbr': {'convert': 'float_none'},
             'abr': {'convert': 'float_none'},
             'asr': {'convert': 'float_none'},
-            'source': {'convert': 'ignore'},
+            'source': {'convert': 'ignore', 'field': 'source_preference'},
 
             'codec': {'type': 'combined', 'field': ('vcodec', 'acodec')},
             'br': {'type': 'combined', 'field': ('tbr', 'vbr', 'abr'), 'same_limit': True},