This commit is contained in:
caiwx86 2023-01-16 04:17:03 +08:00
parent 7a0c306612
commit 5899fd913b

View File

@ -1,5 +1,5 @@
import json
import os,shutil
import os,shutil,time
from datetime import datetime
from pathlib import Path
from zipfile import ZipFile
@ -99,7 +99,9 @@ class CBZUtils:
fz = ZipFile(filepath, 'r')
for file in fz.namelist():
if file.endswith(".jpg"):
is_file = fileUtils.ver_file(fz.read(file),"image")
data = fz.read(file)
time.sleep(1)
is_file = fileUtils.ver_file(data,"image")
if not is_file and os.path.exists(filepath):
os.remove(filepath)
print(f"数据不完整,已删除:{filepath}")