diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-05-15 15:09:32 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-05-15 15:09:32 -0300 |
commit | 15be194dd91cef6a9c58e7712b13b5316e10fd51 (patch) | |
tree | 393b10cb888766adea2b2ebd2a1fe857ad57d31c | |
parent | 600c3dd67fc3be1e6f2cd3cf68189e7e0a276b46 (diff) | |
download | ckandumper-15be194dd91cef6a9c58e7712b13b5316e10fd51.tar.gz ckandumper-15be194dd91cef6a9c58e7712b13b5316e10fd51.tar.bz2 |
Cleanup
-rwxr-xr-x | ckandumper | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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): |