mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Merge pull request #670 from JackDandy/feature/ChangeProvGen
Change add optional login URL.
This commit is contained in:
commit
c7a5f410b0
1 changed files with 10 additions and 1 deletions
|
@ -812,7 +812,16 @@ class TorrentProvider(object, GenericProvider):
|
|||
response = helpers.getURL(url, session=self.session)
|
||||
try:
|
||||
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:
|
||||
return super(TorrentProvider, self)._authorised()
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue