From d88e6b97810f43b0920090b02c863ad847682c88 Mon Sep 17 00:00:00 2001 From: iggyvolz Date: Tue, 14 Oct 2014 14:18:24 +0000 Subject: [PATCH] Fix #595, ratelimit divide by 2 --- youtube_dl/downloader/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/downloader/common.py b/youtube_dl/downloader/common.py index 2a32de5a0..dbdeb5d33 100644 --- a/youtube_dl/downloader/common.py +++ b/youtube_dl/downloader/common.py @@ -146,9 +146,10 @@ class FileDownloader(object): def slow_down(self, start_time, byte_counter): """Sleep if the download speed is over the rate limit.""" - rate_limit = self.params.get('ratelimit', None)/2 + rate_limit = self.params.get('ratelimit', None) if rate_limit is None or byte_counter == 0: return + rate_limit=rate_limit/2 now = time.time() elapsed = now - start_time if elapsed <= 0.0: