mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-20 19:01:23 +02:00
fix #363
This commit is contained in:
parent
7483b8f923
commit
3cae13e76f
@ -57,7 +57,7 @@ class Doujinshi(object):
|
|||||||
|
|
||||||
self.table = [
|
self.table = [
|
||||||
['Parodies', self.info.parodies],
|
['Parodies', self.info.parodies],
|
||||||
['Doujinshi', self.name],
|
['Title', self.name],
|
||||||
['Subtitle', self.info.subtitle],
|
['Subtitle', self.info.subtitle],
|
||||||
['Date', self.info.date],
|
['Date', self.info.date],
|
||||||
['Characters', self.info.characters],
|
['Characters', self.info.characters],
|
||||||
|
@ -4,7 +4,6 @@ import os
|
|||||||
import asyncio
|
import asyncio
|
||||||
import httpx
|
import httpx
|
||||||
import urllib3.exceptions
|
import urllib3.exceptions
|
||||||
import math
|
|
||||||
|
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from nhentai import constant
|
from nhentai import constant
|
||||||
|
@ -5,13 +5,13 @@ import re
|
|||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
import shutil
|
import shutil
|
||||||
import copy
|
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
import requests
|
import requests
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
from typing import Optional, Tuple
|
from typing import Tuple
|
||||||
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
from nhentai import constant
|
from nhentai import constant
|
||||||
from nhentai.logger import logger
|
from nhentai.logger import logger
|
||||||
@ -335,14 +335,15 @@ def generate_metadata_file(output_dir, doujinshi_obj):
|
|||||||
'TRANSLATOR', 'PUBLISHER', 'DESCRIPTION', 'STATUS', 'CHAPTERS', 'PAGES',
|
'TRANSLATOR', 'PUBLISHER', 'DESCRIPTION', 'STATUS', 'CHAPTERS', 'PAGES',
|
||||||
'TAGS', 'TYPE', 'LANGUAGE', 'RELEASED', 'READING DIRECTION', 'CHARACTERS',
|
'TAGS', 'TYPE', 'LANGUAGE', 'RELEASED', 'READING DIRECTION', 'CHARACTERS',
|
||||||
'SERIES', 'PARODY', 'URL']
|
'SERIES', 'PARODY', 'URL']
|
||||||
special_fields = ['PARODY', 'TITLE', 'ORIGINAL TITLE', 'DATE', 'CHARACTERS', 'AUTHOR', 'GROUPS',
|
|
||||||
'LANGUAGE', 'TAGS', 'URL', 'PAGES']
|
|
||||||
|
|
||||||
for i in range(len(fields)):
|
temp_dict = CaseInsensitiveDict(dict(doujinshi_obj.table))
|
||||||
f.write(f'{fields[i]}: ')
|
print(doujinshi_obj.info)
|
||||||
if fields[i] in special_fields:
|
for i in fields:
|
||||||
f.write(str(doujinshi_obj.table[special_fields.index(fields[i])][1]))
|
v = temp_dict.get(i)
|
||||||
f.write('\n')
|
v = temp_dict.get(f'{i}s') if v is None else v
|
||||||
|
v = doujinshi_obj.info.get(i.lower(), None) if v is None else v
|
||||||
|
v = doujinshi_obj.info.get(f'{i.lower()}s', "Unknown") if v is None else v
|
||||||
|
f.write(f'{i}: {v}\n')
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
logger.log(16, f'Metadata Info has been written to "{info_txt_path}"')
|
logger.log(16, f'Metadata Info has been written to "{info_txt_path}"')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user