summary refs log tree commit diff
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-02-06 14:27:04 +0100
committerremitamine <remitamine@gmail.com>2016-02-06 14:27:04 +0100
commit6a3828fddd6f6cec28ec8676bcc3918d583db77c (patch)
tree8428d7f4abdcc2fd6ba131852a69c0f4549d2fdf
parent91cb6b50652f1ff395b1c38834ce33e99fa1975c (diff)
downloadyoutube-dl-6a3828fddd6f6cec28ec8676bcc3918d583db77c.tar.gz
youtube-dl-6a3828fddd6f6cec28ec8676bcc3918d583db77c.tar.xz
youtube-dl-6a3828fddd6f6cec28ec8676bcc3918d583db77c.zip
[common] use float conversion instead of using division from __future__
-rw-r--r--youtube_dl/extractor/common.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 271ba3739..9c0421de7 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1,4 +1,4 @@
-from __future__ import unicode_literals, division
+from __future__ import unicode_literals
 
 import base64
 import datetime
@@ -1450,8 +1450,8 @@ class InfoExtractor(object):
                         representation_ms_info = extract_multisegment_info(representation, adaption_set_ms_info)
                         if 'segment_urls' not in representation_ms_info and 'media_template' in representation_ms_info:
                             if 'total_number' not in representation_ms_info and 'segment_duration':
-                                segment_duration = representation_ms_info['segment_duration'] / representation_ms_info['timescale']
-                                representation_ms_info['total_number'] = int(math.ceil(period_duration / segment_duration))
+                                segment_duration = float(representation_ms_info['segment_duration']) / float(representation_ms_info['timescale'])
+                                representation_ms_info['total_number'] = int(math.ceil(float(period_duration) / segment_duration))
                             media_template = representation_ms_info['media_template']
                             media_template = media_template.replace('$RepresentationID$', representation_id)
                             media_template = re.sub(r'\$(Number|Bandwidth)(?:%(0\d+)d)?\$', r'%(\1)\2d', media_template)