youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit b0d21deda95e7e49e162c12aa305f27e477e0ce9
parent fab6f0e65b0084ce8b29c0810b874d132ffcd47c
Author: Sergey M․ <dstftw@gmail.com>
Date:   Wed, 27 Jan 2016 21:11:17 +0600

[extractor/common] Auto calculate tbr when missing

Diffstat:
Myoutube_dl/extractor/common.py | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py @@ -825,6 +825,12 @@ class InfoExtractor(object): if not formats: 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): # TODO remove the following workaround from ..utils import determine_ext