diff options
author | morpheus65535 <[email protected]> | 2018-07-10 22:31:58 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2018-07-10 22:31:58 -0400 |
commit | ad4203fb8e8183366918e2d86f72db0a7b07c080 (patch) | |
tree | b48f49b8e8560a4b5c33fa663094bd54b74143c2 /bazarr.py | |
parent | 8825a83c957d40db59543baa657b0179a3ad6701 (diff) | |
download | bazarr-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.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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()
|