mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-02 09:49:36 +01:00
Fixed a couple log messages in sab.py to make it a little less redundant and fixed some log grammar in requests.py
This commit is contained in:
@@ -95,7 +95,7 @@ def request_response(url, method="get", auto_raise=True,
|
|||||||
"host is up and running.")
|
"host is up and running.")
|
||||||
except requests.Timeout:
|
except requests.Timeout:
|
||||||
logger.error(
|
logger.error(
|
||||||
"Request timed out. The remote host did not respond timely.")
|
"Request timed out. The remote host did not respond in a timely manner.")
|
||||||
except requests.HTTPError as e:
|
except requests.HTTPError as e:
|
||||||
if e.response is not None:
|
if e.response is not None:
|
||||||
if e.response.status_code >= 500:
|
if e.response.status_code >= 500:
|
||||||
|
|||||||
@@ -48,14 +48,13 @@ def sab_api_call(request_type=None, params={}, **kwargs):
|
|||||||
|
|
||||||
params['output']='json'
|
params['output']='json'
|
||||||
|
|
||||||
logger.info("Attempting to connect to SABnzbd on url: %s" % url)
|
|
||||||
response = request.request_json(url, params=params, **kwargs)
|
response = request.request_json(url, params=params, **kwargs)
|
||||||
|
|
||||||
if not response:
|
if not response:
|
||||||
logger.error("Error connecting to SABnzbd on url: %s" % url)
|
logger.error("Error connecting to SABnzbd on url: %s" % headphones.CONFIG.SAB_HOST)
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
logger.info("Successfully connected to SABnzbd on url: %s" % url)
|
logger.info("Successfully connected to SABnzbd on url: %s" % headphones.CONFIG.SAB_HOST)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def sendNZB(nzb):
|
def sendNZB(nzb):
|
||||||
|
|||||||
Reference in New Issue
Block a user