aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):