From ef8701ed59d8dd51c1ea5837ce25f946c7b9a89c Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Wed, 8 Jun 2016 22:22:07 +0930 Subject: [PATCH] fix autofork detection. Fixes #1056 --- core/nzbToMediaAutoFork.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/nzbToMediaAutoFork.py b/core/nzbToMediaAutoFork.py index 105e758c..1f5b418f 100644 --- a/core/nzbToMediaAutoFork.py +++ b/core/nzbToMediaAutoFork.py @@ -21,7 +21,10 @@ def autoFork(section, inputCategory): apikey = cfg.get("apikey") ssl = int(cfg.get("ssl", 0)) web_root = cfg.get("web_root", "") - fork = core.FORKS.items()[core.FORKS.keys().index(cfg.get("fork", "auto"))] + try: + fork = core.FORKS.items()[core.FORKS.keys().index(cfg.get("fork", "auto"))] + except: + fork = "auto" protocol = "https://" if ssl else "http://" detected = False @@ -68,7 +71,7 @@ def autoFork(section, inputCategory): r = [] if r and r.ok: for param in params: - if not 'name={param!r}'.format(param=param) in r.text: + if not 'name="{param}"'.format(param=param) in r.text: rem_params.append(param) for param in rem_params: params.pop(param)