mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -08:00
Fix #595, ratelimit divide by 2
This commit is contained in:
parent
79d0a746c3
commit
d88e6b9781
@ -146,9 +146,10 @@ class FileDownloader(object):
|
|||||||
|
|
||||||
def slow_down(self, start_time, byte_counter):
|
def slow_down(self, start_time, byte_counter):
|
||||||
"""Sleep if the download speed is over the rate limit."""
|
"""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:
|
if rate_limit is None or byte_counter == 0:
|
||||||
return
|
return
|
||||||
|
rate_limit=rate_limit/2
|
||||||
now = time.time()
|
now = time.time()
|
||||||
elapsed = now - start_time
|
elapsed = now - start_time
|
||||||
if elapsed <= 0.0:
|
if elapsed <= 0.0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user