|
|
@ -22,7 +22,7 @@ def get_profile_list():
|
|
|
|
url_sonarr_api_series = url_sonarr() + "/api/v3/languageprofile?apikey=" + apikey_sonarr
|
|
|
|
url_sonarr_api_series = url_sonarr() + "/api/v3/languageprofile?apikey=" + apikey_sonarr
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
profiles_json = requests.get(url_sonarr_api_series, timeout=60, verify=False, headers=headers)
|
|
|
|
profiles_json = requests.get(url_sonarr_api_series, timeout=int(settings.sonarr.http_timeout), verify=False, headers=headers)
|
|
|
|
except requests.exceptions.ConnectionError:
|
|
|
|
except requests.exceptions.ConnectionError:
|
|
|
|
logging.exception("BAZARR Error trying to get profiles from Sonarr. Connection Error.")
|
|
|
|
logging.exception("BAZARR Error trying to get profiles from Sonarr. Connection Error.")
|
|
|
|
return None
|
|
|
|
return None
|
|
|
@ -55,7 +55,7 @@ def get_tags():
|
|
|
|
url_sonarr_api_series = url_sonarr() + "/api/v3/tag?apikey=" + apikey_sonarr
|
|
|
|
url_sonarr_api_series = url_sonarr() + "/api/v3/tag?apikey=" + apikey_sonarr
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
tagsDict = requests.get(url_sonarr_api_series, timeout=60, verify=False, headers=headers)
|
|
|
|
tagsDict = requests.get(url_sonarr_api_series, timeout=int(settings.sonarr.http_timeout), verify=False, headers=headers)
|
|
|
|
except requests.exceptions.ConnectionError:
|
|
|
|
except requests.exceptions.ConnectionError:
|
|
|
|
logging.exception("BAZARR Error trying to get tags from Sonarr. Connection Error.")
|
|
|
|
logging.exception("BAZARR Error trying to get tags from Sonarr. Connection Error.")
|
|
|
|
return []
|
|
|
|
return []
|
|
|
@ -73,7 +73,7 @@ def get_series_from_sonarr_api(url, apikey_sonarr, sonarr_series_id=None):
|
|
|
|
url_sonarr_api_series = url + "/api/{0}series/{1}?apikey={2}".format(
|
|
|
|
url_sonarr_api_series = url + "/api/{0}series/{1}?apikey={2}".format(
|
|
|
|
'' if get_sonarr_info.is_legacy() else 'v3/', sonarr_series_id if sonarr_series_id else "", apikey_sonarr)
|
|
|
|
'' if get_sonarr_info.is_legacy() else 'v3/', sonarr_series_id if sonarr_series_id else "", apikey_sonarr)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
r = requests.get(url_sonarr_api_series, timeout=60, verify=False, headers=headers)
|
|
|
|
r = requests.get(url_sonarr_api_series, timeout=int(settings.sonarr.http_timeout), verify=False, headers=headers)
|
|
|
|
r.raise_for_status()
|
|
|
|
r.raise_for_status()
|
|
|
|
except requests.exceptions.HTTPError as e:
|
|
|
|
except requests.exceptions.HTTPError as e:
|
|
|
|
if e.response.status_code:
|
|
|
|
if e.response.status_code:
|
|
|
@ -108,7 +108,7 @@ def get_episodes_from_sonarr_api(url, apikey_sonarr, series_id=None, episode_id=
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
r = requests.get(url_sonarr_api_episode, timeout=60, verify=False, headers=headers)
|
|
|
|
r = requests.get(url_sonarr_api_episode, timeout=int(settings.sonarr.http_timeout), verify=False, headers=headers)
|
|
|
|
r.raise_for_status()
|
|
|
|
r.raise_for_status()
|
|
|
|
except requests.exceptions.HTTPError:
|
|
|
|
except requests.exceptions.HTTPError:
|
|
|
|
logging.exception("BAZARR Error trying to get episodes from Sonarr. Http error.")
|
|
|
|
logging.exception("BAZARR Error trying to get episodes from Sonarr. Http error.")
|
|
|
@ -136,7 +136,7 @@ def get_episodesFiles_from_sonarr_api(url, apikey_sonarr, series_id=None, episod
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
r = requests.get(url_sonarr_api_episodeFiles, timeout=60, verify=False, headers=headers)
|
|
|
|
r = requests.get(url_sonarr_api_episodeFiles, timeout=int(settings.sonarr.http_timeout), verify=False, headers=headers)
|
|
|
|
r.raise_for_status()
|
|
|
|
r.raise_for_status()
|
|
|
|
except requests.exceptions.HTTPError:
|
|
|
|
except requests.exceptions.HTTPError:
|
|
|
|
logging.exception("BAZARR Error trying to get episodeFiles from Sonarr. Http error.")
|
|
|
|
logging.exception("BAZARR Error trying to get episodeFiles from Sonarr. Http error.")
|
|
|
|