diff --git a/src/common/utils.py b/src/common/utils.py index 687a35b..0a653ce 100644 --- a/src/common/utils.py +++ b/src/common/utils.py @@ -342,7 +342,7 @@ class CBZUtils: for file in filenames: # 假设图片格式为 JPG 或 ComicInfo.xml count += 1 - print("打包中:" + str(count) + "/" + str(len(filenames)), os.path.join(source_dir, file.name)) + 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} 个文件") @@ -372,15 +372,15 @@ class CBZUtils: try: ImageUtils.deScrambleImagesByPath(os.path.join(chapter_dir,file)) except Exception as e: - print(f"删除 {file} 发生错误 {e},已跳过") + logger.error(f"删除 {file} 发生错误 {e},已跳过") return False if self._zip_compression(source_dir=chapter_dir, target_file=self.cbz_path, remove=False): - logger.info(f"章节 {chapter_dir.name} 打包完成: {self.cbz_path}") + logger.debug(f"章节 {chapter_dir.name} 打包完成: {self.cbz_path}") time.sleep(0.5) if clear_chapter: try: shutil.rmtree(chapter_dir) - logger.info(f"{chapter_dir} 章节原图片已删除") + logger.debug(f"{chapter_dir} 章节原图片已删除") except: raise exit(f"{chapter_dir} 章节删除错误") else: @@ -526,7 +526,7 @@ class ImageUtils: save_file_path = os.path.join(base_dir,save_name) print("sva",save_file_path) if os.path.exists(save_file_path): - print("图片已解密,已跳过:", save_file_path) + logger.debug("图片已解密,已跳过:", save_file_path) return None image_su = str(file_path).split(".")[-1] try: @@ -678,7 +678,7 @@ class ImageUtils: newh += b_h newimage.save(save_path) - logging.info(f"解密成功 {save_path}") + logging.debug(f"解密成功 {save_path}") if os.path.exists(img_path): os.remove(img_path) logging.debug(f"remove {img_path}")