]> jfr.im git - yt-dlp.git/blobdiff - youtube_dl/extractor/youtube.py
Add more tests for format selection
[yt-dlp.git] / youtube_dl / extractor / youtube.py
index 9fb07b3664dd72bfc8ebbfc6dae2a11374483051..829d84e9b4bf3e90f00bb6a047bc9f5594a06664 100644 (file)
@@ -1432,10 +1432,8 @@ def _extract_count(klass):
                 'height':      height,
                 'format_note': note,
             })
-        def _formats_key(f):
-            return (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 = sorted(formats, key=_formats_key)
+
+        self._sort_formats(formats)
 
         return {
             'id':           video_id,