mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
This commit is contained in:
parent
0e94b139ba
commit
fb24a987ca
2 changed files with 16 additions and 10 deletions
|
@ -62,17 +62,17 @@ FORKS = {}
|
||||||
FORK_DEFAULT = "default"
|
FORK_DEFAULT = "default"
|
||||||
FORK_FAILED = "failed"
|
FORK_FAILED = "failed"
|
||||||
FORK_FAILED_TORRENT = "failed-torrent"
|
FORK_FAILED_TORRENT = "failed-torrent"
|
||||||
FORK_SICKRAGETV = "SickRageTV"
|
|
||||||
FORK_SICKRAGE = "SickRage"
|
FORK_SICKRAGE = "SickRage"
|
||||||
FORK_SICKRAGE_API = "SiCKRAGE-api"
|
FORK_SICKCHILL = "SickChill"
|
||||||
|
FORK_SICKBEARD_API = "SickBeard-api"
|
||||||
FORK_MEDUSA = "Medusa"
|
FORK_MEDUSA = "Medusa"
|
||||||
FORK_SICKGEAR = "SickGear"
|
FORK_SICKGEAR = "SickGear"
|
||||||
FORKS[FORK_DEFAULT] = {"dir": None}
|
FORKS[FORK_DEFAULT] = {"dir": None}
|
||||||
FORKS[FORK_FAILED] = {"dirName": None, "failed": None}
|
FORKS[FORK_FAILED] = {"dirName": None, "failed": None}
|
||||||
FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None}
|
FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None}
|
||||||
FORKS[FORK_SICKRAGETV] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None}
|
FORKS[FORK_SICKRAGE] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None}
|
||||||
FORKS[FORK_SICKRAGE] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "force_next": None}
|
FORKS[FORK_SICKCHILL] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "force_next": None}
|
||||||
FORKS[FORK_SICKRAGE_API] = {"path": None, "failed": None, "process_method": None, "force_replace": None, "return_data": None, "type": None, "delete": None, "force_next": None}
|
FORKS[FORK_SICKBEARD_API] = {"path": None, "failed": None, "process_method": None, "force_replace": None, "return_data": None, "type": None, "delete": None, "force_next": None}
|
||||||
FORKS[FORK_MEDUSA] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "ignore_subs":None}
|
FORKS[FORK_MEDUSA] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "ignore_subs":None}
|
||||||
FORKS[FORK_SICKGEAR] = {"dir": None, "failed": None, "process_method": None, "force": None}
|
FORKS[FORK_SICKGEAR] = {"dir": None, "failed": None, "process_method": None, "force": None}
|
||||||
ALL_FORKS = {k:None for k in set(list(itertools.chain.from_iterable([FORKS[x].keys() for x in FORKS.keys()])))}
|
ALL_FORKS = {k:None for k in set(list(itertools.chain.from_iterable([FORKS[x].keys() for x in FORKS.keys()])))}
|
||||||
|
|
|
@ -21,7 +21,7 @@ def autoFork(section, inputCategory):
|
||||||
apikey = cfg.get("apikey")
|
apikey = cfg.get("apikey")
|
||||||
ssl = int(cfg.get("ssl", 0))
|
ssl = int(cfg.get("ssl", 0))
|
||||||
web_root = cfg.get("web_root", "")
|
web_root = cfg.get("web_root", "")
|
||||||
replace = {'sickrage':'SickRage', 'sickragetv':'SickRageTV', 'sickgear':'SickGear', 'medusa':'Medusa', 'sickrage-api':'SiCKRAGE-api'}
|
replace = {'sickrage':'SickRage', 'sickchill':'SickChill', 'sickgear':'SickGear', 'medusa':'Medusa', 'sickbeard-api':'SickBeard-api'}
|
||||||
f1 = replace[cfg.get("fork", "auto")] if cfg.get("fork", "auto") in replace else cfg.get("fork", "auto")
|
f1 = replace[cfg.get("fork", "auto")] if cfg.get("fork", "auto") in replace else cfg.get("fork", "auto")
|
||||||
try:
|
try:
|
||||||
fork = core.FORKS.items()[core.FORKS.keys().index(f1)]
|
fork = core.FORKS.items()[core.FORKS.keys().index(f1)]
|
||||||
|
@ -79,11 +79,17 @@ def autoFork(section, inputCategory):
|
||||||
(section=section, category=inputCategory))
|
(section=section, category=inputCategory))
|
||||||
r = []
|
r = []
|
||||||
if r and r.ok:
|
if r and r.ok:
|
||||||
for param in params:
|
if apikey:
|
||||||
if apikey:
|
optionalParameters = []
|
||||||
if param not in r.json()['data']['optionalParameters'].keys():
|
try:
|
||||||
|
optionalParameters = r.json()['data']['optionalParameters'].keys()
|
||||||
|
except:
|
||||||
|
optionalParameters = r.json()['data']['data']['optionalParameters'].keys()
|
||||||
|
for param in params:
|
||||||
|
if param not in optionalParameters:
|
||||||
rem_params.append(param)
|
rem_params.append(param)
|
||||||
else:
|
else:
|
||||||
|
for param in params:
|
||||||
if 'name="{param}"'.format(param=param) not in r.text:
|
if 'name="{param}"'.format(param=param) not in r.text:
|
||||||
rem_params.append(param)
|
rem_params.append(param)
|
||||||
for param in rem_params:
|
for param in rem_params:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue