]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/redbee.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / redbee.py
index ee510eb40f6cbefea7c5cd6e83b34b72e5230476..b59b518b135301b00f93b805ae81e19b56ddf2f8 100644 (file)
@@ -117,13 +117,10 @@ def _real_extract(self, url):
         video_id = self._match_id(url)
 
         formats, subtitles = self._get_formats_and_subtitles(video_id)
-        self._sort_formats(formats)
 
         video_info = self._download_json(
             f'https://www.parliamentlive.tv/Event/GetShareVideo/{video_id}', video_id, fatal=False)
 
-        self._sort_formats(formats, ['res', 'proto'])
-
         return {
             'id': video_id,
             'formats': formats,
@@ -132,6 +129,7 @@ def _real_extract(self, url):
             'thumbnail': traverse_obj(video_info, 'thumbnailUrl'),
             'timestamp': traverse_obj(
                 video_info, ('event', 'publishedStartTime'), expected_type=unified_timestamp),
+            '_format_sort_fields': ('res', 'proto'),
         }
 
 
@@ -366,7 +364,6 @@ def _real_extract(self, url):
             formats.extend(fmts)
             self._merge_subtitles(subs, target=subtitles)
 
-        self._sort_formats(formats, ['res', 'proto'])
         return {
             'id': media_id,
             'formats': formats,
@@ -378,4 +375,5 @@ def _real_extract(self, url):
             'series': data.get('programLabel'),
             'subtitles': subtitles,
             'is_live': is_live,
+            '_format_sort_fields': ('res', 'proto'),
         }