mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-30 08:10:46 +02:00
fix #356
This commit is contained in:
parent
b841747761
commit
eae42c8eb5
@ -64,8 +64,7 @@ class Downloader(Singleton):
|
|||||||
|
|
||||||
filename = filename if filename else os.path.basename(urlparse(url).path)
|
filename = filename if filename else os.path.basename(urlparse(url).path)
|
||||||
base_filename, extension = os.path.splitext(filename)
|
base_filename, extension = os.path.splitext(filename)
|
||||||
digits = int(math.log10(length)) + 1
|
filename = base_filename.zfill(length) + extension
|
||||||
filename = base_filename.zfill(digits) + extension
|
|
||||||
|
|
||||||
save_file_path = os.path.join(self.folder, filename)
|
save_file_path = os.path.join(self.folder, filename)
|
||||||
|
|
||||||
@ -153,8 +152,9 @@ class Downloader(Singleton):
|
|||||||
# Assuming we want to continue with rest of process.
|
# Assuming we want to continue with rest of process.
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
digit_length = len(str(len(queue)))
|
||||||
coroutines = [
|
coroutines = [
|
||||||
self._semaphore_download(url, filename=os.path.basename(urlparse(url).path), length=len(queue))
|
self._semaphore_download(url, filename=os.path.basename(urlparse(url).path), length=digit_length)
|
||||||
for url in queue
|
for url in queue
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -135,7 +135,6 @@ def doujinshi_parser(id_, counter=0):
|
|||||||
logger.warning(f'Error: {e}, ignored')
|
logger.warning(f'Error: {e}, ignored')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# print(response)
|
|
||||||
html = BeautifulSoup(response, 'html.parser')
|
html = BeautifulSoup(response, 'html.parser')
|
||||||
doujinshi_info = html.find('div', attrs={'id': 'info'})
|
doujinshi_info = html.find('div', attrs={'id': 'info'})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user