aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-04-23 11:33:19 +0700
committerSergey M․ <dstftw@gmail.com>2017-04-23 11:33:49 +0700
commit9c99bef704d185783b61a20ea1f5b58c4c55aba6 (patch)
treea28a5f35366c6fa50b04cad46d93205cccfebf7c
parentffbc8386b9298ef343a71bf54d7426a19755fef8 (diff)
downloadyoutube-dl-9c99bef704d185783b61a20ea1f5b58c4c55aba6.tar.xz
[extractor/common] Use float for scaled tbr
-rw-r--r--youtube_dl/extractor/common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 359c549c5..2a099480f 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1420,7 +1420,9 @@ class InfoExtractor(object):
elif line.startswith('#') or not line.strip():
continue
else:
- tbr = int_or_none(last_stream_inf.get('AVERAGE-BANDWIDTH') or last_stream_inf.get('BANDWIDTH'), scale=1000)
+ tbr = float_or_none(
+ last_stream_inf.get('AVERAGE-BANDWIDTH') or
+ last_stream_inf.get('BANDWIDTH'), scale=1000)
format_id = []
if m3u8_id:
format_id.append(m3u8_id)
@@ -1850,7 +1852,7 @@ class InfoExtractor(object):
'ext': mimetype2ext(mime_type),
'width': int_or_none(representation_attrib.get('width')),
'height': int_or_none(representation_attrib.get('height')),
- 'tbr': int_or_none(bandwidth, 1000),
+ 'tbr': float_or_none(bandwidth, 1000),
'asr': int_or_none(representation_attrib.get('audioSamplingRate')),
'fps': int_or_none(representation_attrib.get('frameRate')),
'language': lang if lang not in ('mul', 'und', 'zxx', 'mis') else None,