This commit is contained in:
cwx committed 2023-01-16 04:17:03 +08:00
1 parent 7a0c306612
commit 5899fd913b
1 file changed
+4 -2
+4 -2
View File
@@ -1,5 +1,5 @@
import json import json
import os,shutil import os,shutil,time
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
from zipfile import ZipFile from zipfile import ZipFile
@@ -99,7 +99,9 @@ class CBZUtils:
fz = ZipFile(filepath, 'r') fz = ZipFile(filepath, 'r')
for file in fz.namelist(): for file in fz.namelist():
if file.endswith(".jpg"): 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): if not is_file and os.path.exists(filepath):
os.remove(filepath) os.remove(filepath)
print(f"数据不完整,已删除:{filepath}") print(f"数据不完整,已删除:{filepath}")