mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 05:13:16 -07:00
This commit is contained in:
parent
2f62df825a
commit
330ef6a23a
3 changed files with 16 additions and 12 deletions
|
@ -214,8 +214,11 @@
|
|||
# Mylar port.
|
||||
#myport=8090
|
||||
|
||||
# Mylar api key.
|
||||
#myapikey=
|
||||
# Mylar username.
|
||||
#myusername=
|
||||
|
||||
# Mylar password.
|
||||
#mypassword=
|
||||
|
||||
# Mylar uses ssl (0, 1).
|
||||
#
|
||||
|
@ -401,9 +404,8 @@ def process(inputDirectory, inputName=None, status=0, clientAgent='manual', down
|
|||
sectionName, inputCategory))
|
||||
return -1
|
||||
except:
|
||||
logger.error('Remote Path is not valid for %s:%s Please set this to either 0 to disable or 1 to enable, exiting!' % (
|
||||
sectionName, inputCategory))
|
||||
return -1
|
||||
logger.error('Remote Path %s is not valid for %s:%s Please set this to either 0 to disable or 1 to enable!' % (
|
||||
section[inputCategory]['remote_path'], sectionName, inputCategory))
|
||||
|
||||
if extract == 1:
|
||||
logger.debug('Checking for archives to extract in directory: %s' % (inputDirectory))
|
||||
|
|
|
@ -38,8 +38,11 @@
|
|||
# Mylar port.
|
||||
#myport=8090
|
||||
|
||||
# Mylar api key.
|
||||
#myapikey=
|
||||
# Mylar username.
|
||||
#myusername=
|
||||
|
||||
# Mylar password.
|
||||
#mypassword=
|
||||
|
||||
# Mylar uses ssl (0, 1).
|
||||
#
|
||||
|
|
|
@ -14,7 +14,8 @@ class autoProcessComics:
|
|||
|
||||
host = nzbtomedia.CFG[section][inputCategory]["host"]
|
||||
port = nzbtomedia.CFG[section][inputCategory]["port"]
|
||||
apikey = nzbtomedia.CFG[section][inputCategory]["apikey"]
|
||||
username = nzbtomedia.CFG[section][inputCategory]["username"]
|
||||
password = nzbtomedia.CFG[section][inputCategory]["password"]
|
||||
try:
|
||||
ssl = int(nzbtomedia.CFG[section][inputCategory]["ssl"])
|
||||
except:
|
||||
|
@ -33,8 +34,6 @@ class autoProcessComics:
|
|||
replaceExtensions(dirName)
|
||||
|
||||
params = {}
|
||||
params['apikey'] = apikey
|
||||
params['cmd'] = "forceProcess"
|
||||
params['nzb_folder'] = dirName
|
||||
if remote_path:
|
||||
params['nzb_folder'] = remoteDir(dirName)
|
||||
|
@ -47,14 +46,14 @@ class autoProcessComics:
|
|||
else:
|
||||
protocol = "http://"
|
||||
|
||||
url = "%s%s:%s%s/api" % (protocol, host, port, web_root)
|
||||
url = "%s%s:%s%s/post_process" % (protocol, host, port, web_root)
|
||||
|
||||
success = False
|
||||
|
||||
logger.debug("Opening URL: %s" % (url), section)
|
||||
|
||||
try:
|
||||
r = requests.get(url, params=params, stream=True, verify=False)
|
||||
r = requests.get(url, auth=(username, password), params=params, stream=True, verify=False)
|
||||
except requests.ConnectionError:
|
||||
logger.error("Unable to open URL", section)
|
||||
return 1 # failure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue