mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -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.
|
# Mylar port.
|
||||||
#myport=8090
|
#myport=8090
|
||||||
|
|
||||||
# Mylar api key.
|
# Mylar username.
|
||||||
#myapikey=
|
#myusername=
|
||||||
|
|
||||||
|
# Mylar password.
|
||||||
|
#mypassword=
|
||||||
|
|
||||||
# Mylar uses ssl (0, 1).
|
# Mylar uses ssl (0, 1).
|
||||||
#
|
#
|
||||||
|
@ -401,9 +404,8 @@ def process(inputDirectory, inputName=None, status=0, clientAgent='manual', down
|
||||||
sectionName, inputCategory))
|
sectionName, inputCategory))
|
||||||
return -1
|
return -1
|
||||||
except:
|
except:
|
||||||
logger.error('Remote Path is not valid for %s:%s Please set this to either 0 to disable or 1 to enable, exiting!' % (
|
logger.error('Remote Path %s is not valid for %s:%s Please set this to either 0 to disable or 1 to enable!' % (
|
||||||
sectionName, inputCategory))
|
section[inputCategory]['remote_path'], sectionName, inputCategory))
|
||||||
return -1
|
|
||||||
|
|
||||||
if extract == 1:
|
if extract == 1:
|
||||||
logger.debug('Checking for archives to extract in directory: %s' % (inputDirectory))
|
logger.debug('Checking for archives to extract in directory: %s' % (inputDirectory))
|
||||||
|
|
|
@ -38,8 +38,11 @@
|
||||||
# Mylar port.
|
# Mylar port.
|
||||||
#myport=8090
|
#myport=8090
|
||||||
|
|
||||||
# Mylar api key.
|
# Mylar username.
|
||||||
#myapikey=
|
#myusername=
|
||||||
|
|
||||||
|
# Mylar password.
|
||||||
|
#mypassword=
|
||||||
|
|
||||||
# Mylar uses ssl (0, 1).
|
# Mylar uses ssl (0, 1).
|
||||||
#
|
#
|
||||||
|
|
|
@ -14,7 +14,8 @@ class autoProcessComics:
|
||||||
|
|
||||||
host = nzbtomedia.CFG[section][inputCategory]["host"]
|
host = nzbtomedia.CFG[section][inputCategory]["host"]
|
||||||
port = nzbtomedia.CFG[section][inputCategory]["port"]
|
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:
|
try:
|
||||||
ssl = int(nzbtomedia.CFG[section][inputCategory]["ssl"])
|
ssl = int(nzbtomedia.CFG[section][inputCategory]["ssl"])
|
||||||
except:
|
except:
|
||||||
|
@ -33,8 +34,6 @@ class autoProcessComics:
|
||||||
replaceExtensions(dirName)
|
replaceExtensions(dirName)
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
params['apikey'] = apikey
|
|
||||||
params['cmd'] = "forceProcess"
|
|
||||||
params['nzb_folder'] = dirName
|
params['nzb_folder'] = dirName
|
||||||
if remote_path:
|
if remote_path:
|
||||||
params['nzb_folder'] = remoteDir(dirName)
|
params['nzb_folder'] = remoteDir(dirName)
|
||||||
|
@ -47,14 +46,14 @@ class autoProcessComics:
|
||||||
else:
|
else:
|
||||||
protocol = "http://"
|
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
|
success = False
|
||||||
|
|
||||||
logger.debug("Opening URL: %s" % (url), section)
|
logger.debug("Opening URL: %s" % (url), section)
|
||||||
|
|
||||||
try:
|
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:
|
except requests.ConnectionError:
|
||||||
logger.error("Unable to open URL", section)
|
logger.error("Unable to open URL", section)
|
||||||
return 1 # failure
|
return 1 # failure
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue