fix
This commit is contained in:
parent
f1029fa291
commit
4fa9bf4f3f
@ -98,12 +98,8 @@ class CBZUtils:
|
|||||||
unpack_dir = str(filepath).split(".")[0]
|
unpack_dir = str(filepath).split(".")[0]
|
||||||
fz = ZipFile(filepath, 'r')
|
fz = ZipFile(filepath, 'r')
|
||||||
for file in fz.namelist():
|
for file in fz.namelist():
|
||||||
fz.extract(file, unpack_dir)
|
if file.endswith(".jpg"):
|
||||||
zip_imgs = os.listdir(unpack_dir)
|
is_file = fileUtils.ver_file(fz.read(file),"image")
|
||||||
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 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}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user