Explorar o código

[extractor/common] Restrict checks when auto calculating tbr

Sergey M․ %!s(int64=10) %!d(string=hai) anos
pai
achega
350cf045d8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      youtube_dl/extractor/common.py

+ 1 - 1
youtube_dl/extractor/common.py

@@ -828,7 +828,7 @@ class InfoExtractor(object):
         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:
+            if 'tbr' not in f and f.get('abr') is not None and f.get('vbr') is not None:
                 f['tbr'] = f['abr'] + f['vbr']
 
         def _formats_key(f):