mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Change Case for SickBeard Fork names. https://github.com/SickGear/SickGear/issues/1099
Fix login to SickGear during auto-frok detection. Fixes #1346
This commit is contained in:
parent
189dde26c8
commit
0259b83afa
2 changed files with 10 additions and 5 deletions
|
@ -61,10 +61,10 @@ FORKS = {}
|
|||
FORK_DEFAULT = "default"
|
||||
FORK_FAILED = "failed"
|
||||
FORK_FAILED_TORRENT = "failed-torrent"
|
||||
FORK_SICKRAGETV = "sickragetv"
|
||||
FORK_SICKRAGE = "sickrage"
|
||||
FORK_MEDUSA = "medusa"
|
||||
FORK_SICKGEAR = "sickgear"
|
||||
FORK_SICKRAGETV = "SickRageTV"
|
||||
FORK_SICKRAGE = "SickRage"
|
||||
FORK_MEDUSA = "Medusa"
|
||||
FORK_SICKGEAR = "SickGear"
|
||||
FORKS[FORK_DEFAULT] = {"dir": None}
|
||||
FORKS[FORK_FAILED] = {"dirName": None, "failed": None}
|
||||
FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None}
|
||||
|
|
|
@ -21,8 +21,10 @@ def autoFork(section, inputCategory):
|
|||
apikey = cfg.get("apikey")
|
||||
ssl = int(cfg.get("ssl", 0))
|
||||
web_root = cfg.get("web_root", "")
|
||||
replace = {'sickrage':'SickRage', 'sickragetv':'SickRageTV', 'sickgear':'SickGear', 'medusa':'Medusa'}
|
||||
f1 = replace[cfg.get("fork", "auto")] if cfg.get("fork", "auto") in replace else cfg.get("fork", "auto")
|
||||
try:
|
||||
fork = core.FORKS.items()[core.FORKS.keys().index(cfg.get("fork", "auto"))]
|
||||
fork = core.FORKS.items()[core.FORKS.keys().index(f1)]
|
||||
except:
|
||||
fork = "auto"
|
||||
protocol = "https://" if ssl else "http://"
|
||||
|
@ -61,6 +63,9 @@ def autoFork(section, inputCategory):
|
|||
login = "{protocol}{host}:{port}{root}/login".format(
|
||||
protocol=protocol, host=host, port=port, root=web_root)
|
||||
login_params = {'username': username, 'password': password}
|
||||
r = s.get(login, verify=False, timeout=(30,60))
|
||||
if r.status_code == 401 and r.cookies.get('_xsrf'):
|
||||
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
||||
s.post(login, data=login_params, stream=True, verify=False)
|
||||
r = s.get(url, auth=(username, password), verify=False)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue