From: Ricter Zheng Date: Mon, 7 Jun 2021 09:21:00 +0000 (+0800) Subject: Merge pull request #224 from RicterZ/pull/221 X-Git-Tag: 0.4.17~6 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=6519e6f221a36982d1cc728f3eef7719649c52a8;p=nhentai.git Merge pull request #224 from RicterZ/pull/221 Pull/221 --- 6519e6f221a36982d1cc728f3eef7719649c52a8 diff --cc nhentai/doujinshi.py index 6ff7edb,3dea104..8d00e43 --- a/nhentai/doujinshi.py +++ b/nhentai/doujinshi.py @@@ -70,9 -69,15 +71,9 @@@ class Doujinshi(object) logger.warning('Page count and ext count do not equal') for i in range(1, min(self.pages, len(self.ext)) + 1): - download_queue.append('%s/%d/%d.%s' % (IMAGE_URL, int(self.img_id), i, self.ext[i-1])) + download_queue.append('%s/%d/%d.%s' % (IMAGE_URL, int(self.img_id), i, self.ext[i - 1])) 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]])) - ''' - else: logger.critical('Downloader has not been loaded') diff --cc nhentai/utils.py index eeae3de,f7532bf..e0a5b4d --- a/nhentai/utils.py +++ b/nhentai/utils.py @@@ -251,8 -252,9 +252,8 @@@ def format_filename(s) """ # maybe you can use `--format` to select a suitable filename ban_chars = '\\\'/:,;*?"<>|\t' - filename = s.translate(str.maketrans(ban_chars, ' '*len(ban_chars))).strip() + filename = s.translate(str.maketrans(ban_chars, ' ' * len(ban_chars))).strip() filename = ' '.join(filename.split()) - print(repr(filename)) while filename.endswith('.'): filename = filename[:-1]