diff --git a/nhentai/command.py b/nhentai/command.py index 12b4273..62fc738 100644 --- a/nhentai/command.py +++ b/nhentai/command.py @@ -87,6 +87,7 @@ def main(): if options.zip: options.is_nohtml = True + if not options.is_show: downloader = (CompressedDownloader if options.zip else Downloader)(path=options.output_dir, threads=options.threads, timeout=options.timeout, delay=options.delay, diff --git a/nhentai/utils.py b/nhentai/utils.py index a5f50f2..a6fa899 100644 --- a/nhentai/utils.py +++ b/nhentai/utils.py @@ -1,5 +1,5 @@ # coding: utf-8 - +import json import sys import re import os @@ -147,7 +147,13 @@ def generate_html(output_dir='.', doujinshi_obj=None, template='default'): # serialize_json(doujinshi_obj, doujinshi_dir) name = doujinshi_obj.name else: - name = 'nHentai HTML Viewer' + metadata_path = os.path.join(doujinshi_dir, "metadata.json") + if os.path.exists(metadata_path): + with open(metadata_path, 'r') as file: + doujinshi_info = json.loads(file.read()) + name = doujinshi_info.get("title") + else: + name = 'nHentai HTML Viewer' data = html.format(TITLE=name, IMAGES=image_html, SCRIPTS=js, STYLES=css) try: