mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-07 10:33:38 +00:00
Change add optional login URL.
This commit is contained in:
parent
ae1e02bbee
commit
dd35c7b9f6
1 changed files with 10 additions and 1 deletions
|
@ -812,7 +812,16 @@ class TorrentProvider(object, GenericProvider):
|
||||||
response = helpers.getURL(url, session=self.session)
|
response = helpers.getURL(url, session=self.session)
|
||||||
try:
|
try:
|
||||||
action = re.findall('[<]form[\w\W]+?action="([^"]+)', response)[0]
|
action = re.findall('[<]form[\w\W]+?action="([^"]+)', response)[0]
|
||||||
url = self.urls['config_provider_home_uri'] + action.lstrip('/')
|
url = (self.urls.get('login_base') or
|
||||||
|
self.urls['config_provider_home_uri']) + action.lstrip('/')
|
||||||
|
|
||||||
|
tags = re.findall(r'(?is)(<input.*?name="[^"]+".*?>)', response)
|
||||||
|
nv = [(tup[0]) for tup in [re.findall(r'(?is)name="([^"]+)"(?:.*?value="([^"]+)")?', x)
|
||||||
|
for x in tags]]
|
||||||
|
for name, value in nv:
|
||||||
|
if name not in ('username', 'password'):
|
||||||
|
post_params = isinstance(post_params, type({})) and post_params or {}
|
||||||
|
post_params.setdefault(name, value)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return super(TorrentProvider, self)._authorised()
|
return super(TorrentProvider, self)._authorised()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue