mirror of
https://github.com/kemayo/leech
synced 2025-12-06 00:15:22 +01:00
Give image downloading a timeout
This commit is contained in:
parent
5cb887f767
commit
5bfd1b40a0
1 changed files with 1 additions and 2 deletions
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue