aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-05-15 15:09:32 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-05-15 15:09:32 -0300
commit15be194dd91cef6a9c58e7712b13b5316e10fd51 (patch)
tree393b10cb888766adea2b2ebd2a1fe857ad57d31c
parent600c3dd67fc3be1e6f2cd3cf68189e7e0a276b46 (diff)
downloadckandumper-15be194dd91cef6a9c58e7712b13b5316e10fd51.tar.gz
ckandumper-15be194dd91cef6a9c58e7712b13b5316e10fd51.tar.bz2
Cleanup
-rwxr-xr-xckandumper12
1 files changed, 4 insertions, 8 deletions
diff --git a/ckandumper b/ckandumper
index d447899..945cabd 100755
--- a/ckandumper
+++ b/ckandumper
@@ -29,17 +29,13 @@ class DownloadMultiple:
wget = '/usr/bin/wget'
- def __init__(self, limit_rate, limit_concurrent):
- self.limit_rate = limit_rate
-
- if args.limit_concurrent != None:
- self.limit_concurrent = asyncio.Semaphore(limit_concurrent)
- else:
- self.limit_concurrent = asyncio.Semaphore(20)
-
+ def __init__(self, limit_rate, limit_concurrent = 20):
if not os.path.exists(self.wget):
raise FileNotFoundError('Wget not found in your path; please install it first.')
+ self.limit_rate = limit_rate
+ self.limit_concurrent = asyncio.Semaphore(int(limit_concurrent))
+
def ensuredir(self, dest):
"""Ensures that the destination folder exists"""
if not os.path.exists(dest) and not os.path.isdir(dest):