Browse Source

[extractor/common] Use float for scaled tbr

master-ytdl-org
Sergey M․ 8 years ago
parent
commit
9c99bef704
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      youtube_dl/extractor/common.py

+ 4
- 2
youtube_dl/extractor/common.py View File

@ -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,


Loading…
Cancel
Save