]> jfr.im git - yt-dlp.git/blobdiff - youtube_dl/extractor/youtube.py
Add temporary _sort_formats helper function
[yt-dlp.git] / youtube_dl / extractor / youtube.py
index 55c345e8a8d4f2c48ff2620fa56df98cecd5db6b..829d84e9b4bf3e90f00bb6a047bc9f5594a06664 100644 (file)
@@ -1433,16 +1433,7 @@ def _extract_count(klass):
                 'format_note': note,
             })
 
-        def _formats_key(f):
-            note = f.get('format_note')
-            if note is None:
-                note = u''
-            is_dash = u'DASH' in note
-            return (
-                0 if is_dash else 1,
-                f.get('height') if f.get('height') is not None else -1,
-                f.get('width') if f.get('width') is not None else -1)
-        formats.sort(key=_formats_key)
+        self._sort_formats(formats)
 
         return {
             'id':           video_id,