1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 08:22:56 +01:00

Give image downloading a timeout

This commit is contained in:
David Lynch 2025-03-26 20:55:19 -05:00
parent 5cb887f767
commit 5bfd1b40a0

View file

@ -125,8 +125,7 @@ def get_image_from_url(
return _convert_to_new_format(imgdata, image_format).read(), image_format.lower(), f"image/{image_format.lower()}" return _convert_to_new_format(imgdata, image_format).read(), image_format.lower(), f"image/{image_format.lower()}"
return imgdata, file_ext, f"image/{file_ext}" return imgdata, file_ext, f"image/{file_ext}"
# print(url) img = session.get(url, timeout=(6.01, 30))
img = session.get(url)
image = BytesIO(img.content) image = BytesIO(img.content)
image.seek(0) image.seek(0)