summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2018-07-10 22:31:58 -0400
committermorpheus65535 <[email protected]>2018-07-10 22:31:58 -0400
commitad4203fb8e8183366918e2d86f72db0a7b07c080 (patch)
treeb48f49b8e8560a4b5c33fa663094bd54b74143c2 /bazarr.py
parent8825a83c957d40db59543baa657b0179a3ad6701 (diff)
downloadbazarr-ad4203fb8e8183366918e2d86f72db0a7b07c080.tar.gz
bazarr-ad4203fb8e8183366918e2d86f72db0a7b07c080.zip
Better exception handling and logging when calling Sonarr and Radarr
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bazarr.py b/bazarr.py
index f85796d71..5eaa3db6c 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -130,7 +130,7 @@ def image_proxy(url):
apikey = get_sonarr_settings()[2]
url_image = url_sonarr_short + '/' + url + '?apikey=' + apikey
try:
- img_pil = Image.open(BytesIO(requests.get(url_sonarr_short + '/api' + url_image.split(url_sonarr)[1]).content))
+ img_pil = Image.open(BytesIO(requests.get(url_sonarr_short + '/api' + url_image.split(url_sonarr)[1], timeout=15).content))
except:
return None
else:
@@ -148,10 +148,10 @@ def image_proxy_movies(url):
apikey = get_radarr_settings()[2]
try:
url_image = (url_radarr_short + '/' + url + '?apikey=' + apikey).replace('/fanart.jpg', '/banner.jpg')
- img_pil = Image.open(BytesIO(requests.get(url_radarr_short + '/api' + url_image.split(url_radarr)[1]).content))
+ img_pil = Image.open(BytesIO(requests.get(url_radarr_short + '/api' + url_image.split(url_radarr)[1], timeout=15).content))
except:
url_image = url_radarr_short + '/' + url + '?apikey=' + apikey
- img_pil = Image.open(BytesIO(requests.get(url_radarr_short + '/api' + url_image.split(url_radarr)[1]).content))
+ img_pil = Image.open(BytesIO(requests.get(url_radarr_short + '/api' + url_image.split(url_radarr)[1], timeout=15).content))
img_buffer = BytesIO()
img_pil.tobytes()