mirror of
				https://github.com/ytdl-org/youtube-dl.git
				synced 2025-11-01 09:26:45 -07:00 
			
		
		
		
	[YoutubeIE] Sort formats by resolution
This commit is contained in:
		@@ -1432,6 +1432,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
 | 
			
		||||
                '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)
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
            'id':           video_id,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user