mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 10:36:52 -07:00
Refactor SABNZBD*
This commit is contained in:
parent
4bf842b4f4
commit
5bea8f121e
3 changed files with 15 additions and 15 deletions
|
@ -132,9 +132,9 @@ SAFE_MODE = None
|
|||
NOEXTRACTFAILED = None
|
||||
|
||||
NZB_CLIENTAGENT = None
|
||||
SABNZBDHOST = None
|
||||
SABNZBDPORT = None
|
||||
SABNZBDAPIKEY = None
|
||||
SABNZBD_HOST = None
|
||||
SABNZBD_PORT = None
|
||||
SABNZBD_APIKEY = None
|
||||
NZB_DEFAULTDIR = None
|
||||
|
||||
TORRENT_CLIENTAGENT = None
|
||||
|
@ -260,7 +260,7 @@ def initialize(section=None):
|
|||
TRANSMISSION_HOST, TRANSMISSION_PORT, TRANSMISSION_PASSWORD, TRANSMISSION_USER, COMPRESSEDCONTAINER, MEDIACONTAINER, \
|
||||
METACONTAINER, SECTIONS, ALL_FORKS, TEST_FILE, GENERALOPTS, LOG_GIT, GROUPS, SEVENZIP, CONCAT, VCRF, \
|
||||
__INITIALIZED__, AUTO_UPDATE, APP_FILENAME, USER_DELAY, APP_NAME, TRANSCODE, DEFAULTS, GIT_PATH, GIT_USER, \
|
||||
GIT_BRANCH, GIT_REPO, SYS_ENCODING, NZB_CLIENTAGENT, SABNZBDHOST, SABNZBDPORT, SABNZBDAPIKEY, \
|
||||
GIT_BRANCH, GIT_REPO, SYS_ENCODING, NZB_CLIENTAGENT, SABNZBD_HOST, SABNZBD_PORT, SABNZBD_APIKEY, \
|
||||
DUPLICATE, IGNOREEXTENSIONS, VEXTENSION, OUTPUTVIDEOPATH, PROCESSOUTPUT, VCODEC, VCODEC_ALLOW, VPRESET, \
|
||||
VFRAMERATE, LOG_DB, VBITRATE, VRESOLUTION, ALANGUAGE, AINCLUDE, ACODEC, ACODEC_ALLOW, ABITRATE, FAILED, \
|
||||
ACODEC2, ACODEC2_ALLOW, ABITRATE2, ACODEC3, ACODEC3_ALLOW, ABITRATE3, ALLOWSUBS, SEXTRACT, SEMBED, SLANGUAGES, \
|
||||
|
@ -382,9 +382,9 @@ def initialize(section=None):
|
|||
wake_up()
|
||||
|
||||
NZB_CLIENTAGENT = CFG['Nzb']['clientAgent'] # sabnzbd
|
||||
SABNZBDHOST = CFG['Nzb']['sabnzbd_host']
|
||||
SABNZBDPORT = int(CFG['Nzb']['sabnzbd_port'] or 8080) # defaults to accomodate NzbGet
|
||||
SABNZBDAPIKEY = CFG['Nzb']['sabnzbd_apikey']
|
||||
SABNZBD_HOST = CFG['Nzb']['sabnzbd_host']
|
||||
SABNZBD_PORT = int(CFG['Nzb']['sabnzbd_port'] or 8080) # defaults to accomodate NzbGet
|
||||
SABNZBD_APIKEY = CFG['Nzb']['sabnzbd_apikey']
|
||||
NZB_DEFAULTDIR = CFG['Nzb']['default_downloadDirectory']
|
||||
GROUPS = CFG['Custom']['remove_group']
|
||||
if isinstance(GROUPS, str):
|
||||
|
|
|
@ -101,13 +101,13 @@ def find_download(client_agent, download_id):
|
|||
if torrent['hash'] == download_id:
|
||||
return True
|
||||
if client_agent == 'sabnzbd':
|
||||
if 'http' in core.SABNZBDHOST:
|
||||
base_url = '{0}:{1}/api'.format(core.SABNZBDHOST, core.SABNZBDPORT)
|
||||
if 'http' in core.SABNZBD_HOST:
|
||||
base_url = '{0}:{1}/api'.format(core.SABNZBD_HOST, core.SABNZBD_PORT)
|
||||
else:
|
||||
base_url = 'http://{0}:{1}/api'.format(core.SABNZBDHOST, core.SABNZBDPORT)
|
||||
base_url = 'http://{0}:{1}/api'.format(core.SABNZBD_HOST, core.SABNZBD_PORT)
|
||||
url = base_url
|
||||
params = {
|
||||
'apikey': core.SABNZBDAPIKEY,
|
||||
'apikey': core.SABNZBD_APIKEY,
|
||||
'mode': 'get_files',
|
||||
'output': 'json',
|
||||
'value': download_id,
|
||||
|
|
|
@ -10,13 +10,13 @@ def get_nzoid(input_name):
|
|||
nzoid = None
|
||||
slots = []
|
||||
logger.debug('Searching for nzoid from SAbnzbd ...')
|
||||
if 'http' in core.SABNZBDHOST:
|
||||
base_url = '{0}:{1}/api'.format(core.SABNZBDHOST, core.SABNZBDPORT)
|
||||
if 'http' in core.SABNZBD_HOST:
|
||||
base_url = '{0}:{1}/api'.format(core.SABNZBD_HOST, core.SABNZBD_PORT)
|
||||
else:
|
||||
base_url = 'http://{0}:{1}/api'.format(core.SABNZBDHOST, core.SABNZBDPORT)
|
||||
base_url = 'http://{0}:{1}/api'.format(core.SABNZBD_HOST, core.SABNZBD_PORT)
|
||||
url = base_url
|
||||
params = {
|
||||
'apikey': core.SABNZBDAPIKEY,
|
||||
'apikey': core.SABNZBD_APIKEY,
|
||||
'mode': 'queue',
|
||||
'output': 'json',
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue