aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/FileDownloader.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-11-26 04:13:43 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-11-26 04:13:43 +0100
commit7ec1a206eaedcb35c16ba54289d3c7f92baa59ce (patch)
treef161aeb825a30aceed84779450db2869b63398e2 /youtube_dl/FileDownloader.py
parent51937c086943a3bdbf6f707c75d041ed3b0ba743 (diff)
downloadyoutube-dl-7ec1a206eaedcb35c16ba54289d3c7f92baa59ce.tar.xz
Remove longs (int does the right thing since Python 2.2, see PEP 237)
Diffstat (limited to 'youtube_dl/FileDownloader.py')
-rw-r--r--youtube_dl/FileDownloader.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py
index 9feff9bb0..ff6963262 100644
--- a/youtube_dl/FileDownloader.py
+++ b/youtube_dl/FileDownloader.py
@@ -139,23 +139,23 @@ class FileDownloader(object):
new_min = max(bytes / 2.0, 1.0)
new_max = min(max(bytes * 2.0, 1.0), 4194304) # Do not surpass 4 MB
if elapsed_time < 0.001:
- return long(new_max)
+ return int(new_max)
rate = bytes / elapsed_time
if rate > new_max:
- return long(new_max)
+ return int(new_max)
if rate < new_min:
- return long(new_min)
- return long(rate)
+ return int(new_min)
+ return int(rate)
@staticmethod
def parse_bytes(bytestr):
- """Parse a string indicating a byte quantity into a long integer."""
+ """Parse a string indicating a byte quantity into an integer."""
matchobj = re.match(r'(?i)^(\d+(?:\.\d+)?)([kMGTPEZY]?)$', bytestr)
if matchobj is None:
return None
number = float(matchobj.group(1))
multiplier = 1024.0 ** 'bkmgtpezy'.index(matchobj.group(2).lower())
- return long(round(number * multiplier))
+ return int(round(number * multiplier))
def add_info_extractor(self, ie):
"""Add an InfoExtractor object to the end of the list."""