mirror of
				https://code.hackerspace.pl/q3k/youtube-dl
				synced 2025-03-16 11:43:02 +00:00 
			
		
		
		
	[YoutubeIE] Sort formats by resolution
This commit is contained in:
		
							parent
							
								
									dbd1988ed9
								
							
						
					
					
						commit
						e56f22ae20
					
				| @ -1432,6 +1432,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor): | |||||||
|                 'height':      height, |                 'height':      height, | ||||||
|                 'format_note': note, |                 '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 { |         return { | ||||||
|             'id':           video_id, |             'id':           video_id, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 rzhxeo
						rzhxeo