From 15be194dd91cef6a9c58e7712b13b5316e10fd51 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 15 May 2019 15:09:32 -0300 Subject: Cleanup --- ckandumper | 12 ++++-------- 1 file 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): -- cgit v1.2.3