1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[extractor/common] Fix Bandwidth substitution in media template (closes #11175)

This commit is contained in:
Sergey M․ 2016-11-13 05:43:34 +07:00
parent 577281b0c6
commit 4ea4c0bb22
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -1703,7 +1703,7 @@ class InfoExtractor(object):
representation_ms_info['fragments'] = [{ representation_ms_info['fragments'] = [{
'url': media_template % { 'url': media_template % {
'Number': segment_number, 'Number': segment_number,
'Bandwidth': representation_attrib.get('bandwidth'), 'Bandwidth': int_or_none(representation_attrib.get('bandwidth')),
}, },
'duration': segment_duration, 'duration': segment_duration,
} for segment_number in range( } for segment_number in range(
@ -1721,7 +1721,7 @@ class InfoExtractor(object):
def add_segment_url(): def add_segment_url():
segment_url = media_template % { segment_url = media_template % {
'Time': segment_time, 'Time': segment_time,
'Bandwidth': representation_attrib.get('bandwidth'), 'Bandwidth': int_or_none(representation_attrib.get('bandwidth')),
'Number': segment_number, 'Number': segment_number,
} }
representation_ms_info['fragments'].append({ representation_ms_info['fragments'].append({