mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 10:36:52 -07:00
Fixed some issues with login/pass posting
This commit is contained in:
parent
5f2a5499b8
commit
9306230f7e
2 changed files with 4 additions and 6 deletions
|
@ -282,7 +282,7 @@ class autoProcessTV(object):
|
|||
if section == "SickBeard":
|
||||
logger.debug("Opening URL: {0} with params: {1}".format(url, fork_params), section)
|
||||
s = requests.Session()
|
||||
if not apikey:
|
||||
if not apikey and username and password:
|
||||
login = "{0}{1}:{2}{3}/login".format(protocol, host, port, web_root)
|
||||
login_params = {'username': username, 'password': password}
|
||||
s.post(login, data=login_params, stream=True, verify=False, timeout=(30, 60))
|
||||
|
|
|
@ -62,15 +62,13 @@ def autoFork(section, inputCategory):
|
|||
|
||||
# attempting to auto-detect fork
|
||||
try:
|
||||
if username and password:
|
||||
s = requests.Session()
|
||||
s = requests.Session()
|
||||
if not apikey and username and password:
|
||||
login = "{protocol}{host}:{port}{root}/login".format(
|
||||
protocol=protocol, host=host, port=port, root=web_root)
|
||||
login_params = {'username': username, 'password': password}
|
||||
s.post(login, data=login_params, stream=True, verify=False)
|
||||
r = s.get(url, auth=(username, password), verify=False)
|
||||
else:
|
||||
r = requests.get(url, verify=False)
|
||||
r = s.get(url, auth=(username, password), verify=False)
|
||||
except requests.ConnectionError:
|
||||
logger.info("Could not connect to {section}:{category} to perform auto-fork detection!".format
|
||||
(section=section, category=inputCategory))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue