Fixed typo and implemented file checking to prevent redownloading
This commit is contained in:
parent
7b70a73ac2
commit
6d011ffbd4
@ -93,7 +93,15 @@ class CalibreTools:
|
||||
@staticmethod
|
||||
def threadDownloadBook(link, directory_name):
|
||||
try:
|
||||
wget.download(link, directory_name)
|
||||
fragment_removed = link.split("#")[0]
|
||||
query_string_removed = fragment_removed.split("?")[0]
|
||||
scheme_removed = query_string_removed.split("://")[-1].split(":")[-1].replace("%20", " ")
|
||||
if scheme_removed.find("/") != -1:
|
||||
if not os.path.exists(directory_name + "/" + os.path.basename(scheme_removed)):
|
||||
printInfo(f'Downloading {link}')
|
||||
wget.download(link, directory_name)
|
||||
else:
|
||||
printInfo(f'File Exists... Skipping {link}')
|
||||
except:
|
||||
pass
|
||||
CalibreTools.active_threads -= 1
|
||||
CalibreTools.active_threads -= 1
|
||||
|
2
main.py
2
main.py
@ -30,7 +30,7 @@ def calibre_implementation(ip_port):
|
||||
printSuccess(f'Found {len(libraries)} libraries')
|
||||
else:
|
||||
libraries.append(args.lib)
|
||||
if args.thread not is None:
|
||||
if args.thread is not None:
|
||||
thr = args.thread
|
||||
for library in libraries:
|
||||
printInfo(f'Counting books from library: {library}')
|
||||
|
Loading…
Reference in New Issue
Block a user