mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 22:03:13 -07:00
Add new SG api #1712
This commit is contained in:
parent
89a84c2568
commit
aa2fbf5b95
1 changed files with 4 additions and 2 deletions
|
@ -271,7 +271,9 @@ def process(section, dir_name, input_name=None, failed=False, client_agent='manu
|
|||
|
||||
url = None
|
||||
if section == 'SickBeard':
|
||||
if apikey:
|
||||
if apikey and fork == 'SickGear':
|
||||
url = '{0}{1}:{2}{3}/api/{4}/?cmd=sg.postprocess'.format(protocol, host, port, web_root, apikey)
|
||||
elif apikey:
|
||||
url = '{0}{1}:{2}{3}/api/{4}/?cmd=postprocess'.format(protocol, host, port, web_root, apikey)
|
||||
elif fork == 'Stheno':
|
||||
url = '{0}{1}:{2}{3}/home/postprocess/process_episode'.format(protocol, host, port, web_root)
|
||||
|
@ -300,7 +302,7 @@ def process(section, dir_name, input_name=None, failed=False, client_agent='manu
|
|||
login = '{0}{1}:{2}{3}/login'.format(protocol, host, port, 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'):
|
||||
if r.status_code in [401, 403] and r.cookies.get('_xsrf'):
|
||||
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
||||
s.post(login, data=login_params, stream=True, verify=False, timeout=(30, 60))
|
||||
r = s.get(url, auth=(username, password), params=fork_params, stream=True, verify=False, timeout=(30, 1800))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue