mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-19 10:21:19 +02:00
fix download issues
This commit is contained in:
parent
a6074242fb
commit
0c8264bcc6
@ -58,9 +58,17 @@ class Doujinshi(object):
|
||||
logger.info('Starting to download doujinshi: %s' % self.name)
|
||||
if self.downloader:
|
||||
download_queue = []
|
||||
|
||||
for i in range(1, self.pages + 1):
|
||||
download_queue.append('%s/%d/%d.%s' % (IMAGE_URL, int(self.img_id), i, self.ext))
|
||||
|
||||
self.downloader.download(download_queue, self.filename)
|
||||
|
||||
'''
|
||||
for i in range(len(self.ext)):
|
||||
download_queue.append('%s/%d/%d.%s' % (IMAGE_URL, int(self.img_id), i+1, EXT_MAP[self.ext[i]]))
|
||||
self.downloader.download(download_queue, self.filename)
|
||||
'''
|
||||
|
||||
else:
|
||||
logger.critical('Downloader has not been loaded')
|
||||
|
||||
|
@ -121,4 +121,7 @@ an invalid filename.
|
||||
filename = filename.replace(' ', '_') # I don't like spaces in filenames.
|
||||
if len(filename) > 100:
|
||||
filename = filename[:100] + '...]'
|
||||
|
||||
# Remove [] from filename
|
||||
filename = filename.replace('[]', '')
|
||||
return filename
|
||||
|
Loading…
x
Reference in New Issue
Block a user