]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/twitch.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / twitch.py
index 7a798b912d2ac39b6235666ae312999581cd51dd..c59d1cf1711596351e1b5ab45723e8a17cc5677f 100644 (file)
@@ -19,6 +19,7 @@
     dict_get,
     float_or_none,
     int_or_none,
+    make_archive_id,
     parse_duration,
     parse_iso8601,
     parse_qs,
@@ -132,7 +133,6 @@ def _prefer_source(self, formats):
                         'quality': 10,
                         'format_note': 'Source',
                     })
-        self._sort_formats(formats)
 
     def _download_base_gql(self, video_id, ops, note, fatal=True):
         headers = {
@@ -1143,7 +1143,6 @@ def _real_extract(self, url):
                 'height': int_or_none(option.get('quality')),
                 'fps': int_or_none(option.get('frameRate')),
             })
-        self._sort_formats(formats)
 
         thumbnails = []
         for thumbnail_id in ('tiny', 'small', 'medium'):
@@ -1166,9 +1165,9 @@ def _real_extract(self, url):
 
         return {
             'id': clip.get('id') or video_id,
-            '_old_archive_ids': [f'{self.ie_key()} {old_id}'] if old_id else None,
+            '_old_archive_ids': [make_archive_id(self, old_id)] if old_id else None,
             'display_id': video_id,
-            'title': clip.get('title') or video_id,
+            'title': clip.get('title'),
             'formats': formats,
             'duration': int_or_none(clip.get('durationSeconds')),
             'view_count': int_or_none(clip.get('viewCount')),