This commit is contained in:
caiwx86 2023-01-16 03:45:27 +08:00
parent f1029fa291
commit 4fa9bf4f3f

View File

@ -98,12 +98,8 @@ class CBZUtils:
unpack_dir = str(filepath).split(".")[0]
fz = ZipFile(filepath, 'r')
for file in fz.namelist():
fz.extract(file, unpack_dir)
zip_imgs = os.listdir(unpack_dir)
for img in zip_imgs:
if img.endswith(".jpg"):
img_path = os.path.join(unpack_dir,img)
is_file = fileUtils.ver_file(img_path,"image")
if file.endswith(".jpg"):
is_file = fileUtils.ver_file(fz.read(file),"image")
if not is_file and os.path.exists(filepath):
os.remove(filepath)
print(f"数据不完整,已删除:{filepath}")