mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-31 03:12:12 +00:00
Added logging to sonarr/radarr connection testing #900.
This commit is contained in:
parent
8287ff4cf8
commit
b42887c5fa
1 changed files with 4 additions and 3 deletions
|
@ -2093,10 +2093,11 @@ def api_history():
|
||||||
@custom_auth_basic(check_credentials)
|
@custom_auth_basic(check_credentials)
|
||||||
def test_url(protocol, url):
|
def test_url(protocol, url):
|
||||||
authorize()
|
authorize()
|
||||||
url = six.moves.urllib.parse.unquote(url)
|
url = protocol + "://" + six.moves.urllib.parse.unquote(url)
|
||||||
try:
|
try:
|
||||||
result = requests.get(protocol + "://" + url, allow_redirects=False, verify=False).json()['version']
|
result = requests.get(url, allow_redirects=False, verify=False).json()['version']
|
||||||
except:
|
except Exception as e:
|
||||||
|
logging.exception('BAZARR cannot successfully contact this URL: ' + url)
|
||||||
return dict(status=False)
|
return dict(status=False)
|
||||||
else:
|
else:
|
||||||
return dict(status=True, version=result)
|
return dict(status=True, version=result)
|
||||||
|
|
Loading…
Reference in a new issue