mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[extractor/common] Auto calculate tbr when missing
This commit is contained in:
		| @@ -825,6 +825,12 @@ class InfoExtractor(object): | |||||||
|         if not formats: |         if not formats: | ||||||
|             raise ExtractorError('No video formats found') |             raise ExtractorError('No video formats found') | ||||||
|  |  | ||||||
|  |         for f in formats: | ||||||
|  |             # Automatically determine tbr when missing based on abr and vbr (improves | ||||||
|  |             # formats sorting in some cases) | ||||||
|  |             if 'tbr' not in f and 'abr' in f and 'vbr' in f: | ||||||
|  |                 f['tbr'] = f['abr'] + f['vbr'] | ||||||
|  |  | ||||||
|         def _formats_key(f): |         def _formats_key(f): | ||||||
|             # TODO remove the following workaround |             # TODO remove the following workaround | ||||||
|             from ..utils import determine_ext |             from ..utils import determine_ext | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sergey M․
					Sergey M․