From 5bfd1b40a0b94e64f1ffb49475ceeb5ebd4d8348 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Wed, 26 Mar 2025 20:55:19 -0500 Subject: [PATCH] Give image downloading a timeout --- ebook/image.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ebook/image.py b/ebook/image.py index 422b07b..e351614 100644 --- a/ebook/image.py +++ b/ebook/image.py @@ -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 imgdata, file_ext, f"image/{file_ext}" - # print(url) - img = session.get(url) + img = session.get(url, timeout=(6.01, 30)) image = BytesIO(img.content) image.seek(0)