From 4b84a9c64c90d8872266889443ffaa0e44465087 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Wed, 2 Mar 2022 06:34:43 -0500 Subject: [PATCH] Fixed GetSonarrInfo.version() to make sure it doesn't prevent Bazarr startup. --- bazarr/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bazarr/utils.py b/bazarr/utils.py index 6a3cf8951..d16028921 100644 --- a/bazarr/utils.py +++ b/bazarr/utils.py @@ -258,8 +258,12 @@ class GetSonarrInfo: else: raise json.decoder.JSONDecodeError except json.decoder.JSONDecodeError: - sv = url_sonarr() + "/api/v3/system/status?apikey=" + settings.sonarr.apikey - sonarr_version = requests.get(sv, timeout=60, verify=False, headers=headers).json()['version'] + try: + sv = url_sonarr() + "/api/v3/system/status?apikey=" + settings.sonarr.apikey + sonarr_version = requests.get(sv, timeout=60, verify=False, headers=headers).json()['version'] + except json.decoder.JSONDecodeError: + logging.debug('BAZARR cannot get Sonarr version') + sonarr_version = 'unknown' except Exception: logging.debug('BAZARR cannot get Sonarr version') sonarr_version = 'unknown'