add https for SABnzbd. Fixes #823

This commit is contained in:
clinton-hall 2015-09-14 19:43:14 +09:30
commit 6ab821c5ea
2 changed files with 9 additions and 3 deletions

View file

@ -206,7 +206,7 @@
###### clientAgent - Supported clients: sabnzbd, nzbget ###### clientAgent - Supported clients: sabnzbd, nzbget
clientAgent = sabnzbd clientAgent = sabnzbd
###### SabNZBD (You must edit this if your using nzbToMedia.py with SabNZBD) ###### SabNZBD (You must edit this if your using nzbToMedia.py with SabNZBD)
sabnzbd_host = localhost sabnzbd_host = http://localhost
sabnzbd_port = 8080 sabnzbd_port = 8080
sabnzbd_apikey = sabnzbd_apikey =
###### Enter the default path to your default download directory (non-category downloads). this directory is protected by safe_mode. ###### Enter the default path to your default download directory (non-category downloads). this directory is protected by safe_mode.

View file

@ -798,7 +798,10 @@ def find_download(clientAgent, download_id):
if clientAgent == 'deluge': if clientAgent == 'deluge':
return False return False
if clientAgent == 'sabnzbd': if clientAgent == 'sabnzbd':
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT) if "http" in core.SABNZBDHOST:
baseURL = "%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
else:
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
url = baseURL url = baseURL
params = {} params = {}
params['apikey'] = core.SABNZBDAPIKEY params['apikey'] = core.SABNZBDAPIKEY
@ -819,7 +822,10 @@ def find_download(clientAgent, download_id):
def get_nzoid(inputName): def get_nzoid(inputName):
nzoid = None nzoid = None
logger.debug("Searching for nzoid from SAbnzbd ...") logger.debug("Searching for nzoid from SAbnzbd ...")
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT) if "http" in core.SABNZBDHOST:
baseURL = "%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
else:
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
url = baseURL url = baseURL
params = {} params = {}
params['apikey'] = core.SABNZBDAPIKEY params['apikey'] = core.SABNZBDAPIKEY