fix
This commit is contained in:
parent
c289851cc5
commit
2555c8a39d
@ -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"):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user