from nhentai.logger import logger
from nhentai.utils import format_filename
-
EXT_MAP = {
'j': 'jpg',
'p': 'png',
name_format = name_format.replace('%s', self.info.subtitle)
self.filename = format_filename(name_format)
- def __repr__(self):
- return '<Doujinshi: {0}>'.format(self.name)
-
- def show(self):
- table = [
+ self.table = [
["Parodies", self.info.parodies],
["Doujinshi", self.name],
["Subtitle", self.info.subtitle],
["URL", self.url],
["Pages", self.pages],
]
- logger.info(u'Print doujinshi information of {0}\n{1}'.format(self.id, tabulate(table)))
+
+ def __repr__(self):
+ return '<Doujinshi: {0}>'.format(self.name)
+
+ def show(self):
+
+ logger.info(u'Print doujinshi information of {0}\n{1}'.format(self.id, tabulate(self.table)))
def download(self):
logger.info('Starting to download doujinshi: %s' % self.name)
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)
else: