From edf5d33bc650383764964ea898774a9a3d7c27bb Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Thu, 19 Apr 2018 19:41:37 -0400 Subject: [PATCH] Use API to call image_proxy in case Sonarr use authentication --- bazarr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bazarr.py b/bazarr.py index c37b2b487..71672a234 100644 --- a/bazarr.py +++ b/bazarr.py @@ -121,8 +121,9 @@ def download_log(): def image_proxy(url): from get_sonarr_settings import get_sonarr_settings url_sonarr_short = get_sonarr_settings()[1] + apikey = get_sonarr_settings()[2] - img_pil = Image.open(BytesIO(requests.get(url_sonarr_short + '/' + url).content)) + img_pil = Image.open(BytesIO(requests.get(url_sonarr_short + '/' + url + '?apikey=' + apikey).content)) img_buffer = BytesIO() img_pil.tobytes() img_pil.save(img_buffer, img_pil.format)