This commit is contained in:
caiwx86 2023-04-06 00:57:35 +08:00
parent c289851cc5
commit 2555c8a39d

View File

@ -192,16 +192,16 @@ class downloadUtils:
with open(temp_path, 'wb') as f: with open(temp_path, 'wb') as f:
f.write(response.content) f.write(response.content)
response.close() response.close()
#验证是否是图像
if fu.ver_file(temp_path,type="image"):
shutil.move(temp_path, file_path)
print("## OK: {} {}".format(file_path, image_url))
else:
print("## Fail: {} {}".format(image_url, "图像损坏"))
cls.down_queue.put([file_name,image_url,dst_dir])
except Exception as e: except Exception as e:
print(f"common_down() 出错了 {e}") print(f"common_down() 出错了 {e}")
cls.down_queue.put([file_name,image_url,dst_dir]) cls.down_queue.put([file_name,image_url,dst_dir])
#验证是否是图像
if fu.ver_file(temp_path,type="image"):
shutil.move(temp_path, file_path)
print("## OK: {} {}".format(file_path, image_url))
else:
print("## Fail: {} {}".format(image_url, "图像损坏"))
cls.down_queue.put([file_name,image_url,dst_dir])
@classmethod @classmethod
def download_image(cls,timeout=20, proxy_type=None, proxy=None,type="image"): def download_image(cls,timeout=20, proxy_type=None, proxy=None,type="image"):