info debug

This commit is contained in:
caiwx86 2025-02-05 02:22:42 +08:00
parent c9069f5b1e
commit 85a24e8cc7
3 changed files with 8 additions and 8 deletions

View File

@ -277,7 +277,7 @@ class ComicInfoXml:
if not os.path.exists(base_dir): os.makedirs(base_dir)
with open(filename, "w", encoding="utf-8") as file:
file.write(xml_string)
logger.info(f"ComicInfo.xml 生成成功 {filename}")
logger.debug(f"ComicInfo.xml 生成成功 {filename}")
def _validate_xml_with_xsd_file(self, xml_file, xsd_file, remove=True):
"""
@ -288,7 +288,7 @@ class ComicInfoXml:
xsd_doc = etree.XMLSchema(etree.parse(file))
try:
xsd_doc.assertValid(xml_doc)
logger.info(f"ComicInfo.xml 通过 XSD 验证成功 {xml_file}")
logger.debug(f"ComicInfo.xml 通过 XSD 验证成功 {xml_file}")
except etree.DocumentInvalid as e:
logger.error(f"ComicInfo.xml 通过 XSD 验证失败 {xml_file}")
if remove:
@ -306,7 +306,7 @@ class ComicInfoXml:
match = re.search(r"<PageCount>(\d+)</PageCount>", file_string)
if match:
page_count = match.group(1)
logger.info(f"zip_file={zip_file} PageCount: {page_count}")
logger.debug(f"zip_file={zip_file} PageCount: {page_count}")
return page_count
def _parse_comicinfo(self, comic: ComicInfo, save_dir=None, xml_filename="ComicInfo.xml", xsd_filename="ComicInfo.xsd"):

View File

@ -121,7 +121,7 @@ class MangaDownloader:
os.remove(save_path)
else:
"""不更新刚返回"""
logger.info(f"{save_path} 已是更新")
logger.debug(f"{save_path} 已是更新")
return
async with aiohttp.ClientSession(headers=DEFAULT_HEADERS, timeout=aiohttp.ClientTimeout(total=TIMEOUT, connect=TIMEOUT)) as session:
await self.download_image(session,str(cover_item.url), save_path)
@ -285,7 +285,7 @@ class CBZUtils:
match = re.search(r"<PageCount>(\d+)</PageCount>", file_string)
if match:
page_count = match.group(1)
logger.info(f"zip_file={zip_file} PageCount: {page_count}")
logger.debug(f"zip_file={zip_file} PageCount: {page_count}")
return page_count
except Exception as e:
raise exit(f"获取 ComicInfo.xml 文件中的 <PageCount> 标签值失败: {zip_file},错误: {str(e)}")
@ -305,7 +305,7 @@ class CBZUtils:
if is_comic_info:
page_count = self._comic_info_xml_page_count(zip_file_path)
if len(file_list) == int(page_count) + 1:
logger.info(f"ZIP 文件 {zip_file_path} 验证成功")
logger.debug(f"ZIP 文件 {zip_file_path} 验证成功")
result = True
else:
logger.error(f"ZIP 文件 {zip_file_path} 验证失败,文件数量与 ComicInfo.xml 中的 <PageCount> 不一致")
@ -345,7 +345,7 @@ class CBZUtils:
logger.debug("打包中:" + str(count) + "/" + str(len(filenames)), os.path.join(source_dir, file.name))
cbz.write(file, arcname=file.name)
cbz.close()
logger.info(f"打包完成:{target_file}{count} 个文件")
logger.debug(f"打包完成:{target_file}{count} 个文件")
except Exception as e:
logger.error(f"打包失败: {target_file},错误: {str(e)}")
if os.path.exists(target_file):

View File

@ -35,7 +35,7 @@ class BaseSite(ABC):
# 尝试从缓存中获取 HTML 内容
cached_html = self.cache.get(url)
if cached_html:
logger.info(f"从缓存中获取 HTML 内容: {url}")
logger.debug(f"从缓存中获取 HTML 内容: {url}")
return cached_html
for attempt in range(retries):