diff options
author | Stefano <l.stickell@yahoo.it> | 2013-09-22 14:47:11 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-09-22 14:47:11 +0200 |
commit | 619a7920bae008e451e0ef6b79ef6cbb0607021b (patch) | |
tree | 4fcf15b8d07d114bc74318557f0fb1ad0d594a25 | |
parent | Removed SkipRev. See #167 (diff) | |
parent | UlozTo account fix (diff) | |
download | pyload-619a7920bae008e451e0ef6b79ef6cbb0607021b.tar.xz |
Merge pull request #272 from pulpe/acculoztonet
UlozTo: account fix
-rw-r--r-- | module/plugins/accounts/UlozTo.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index dc59db9cc..8a281389e 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -7,10 +7,10 @@ from module.plugins.Account import Account class UlozTo(Account): __name__ = "UlozTo" - __version__ = "0.04" + __version__ = "0.05" __type__ = "account" __description__ = """uloz.to account plugin""" - __author_name__ = ("zoidberg") + __author_name__ = ("zoidberg", "pulpe") __author_mail__ = ("zoidberg@mujmail.cz") TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="http://www.ulozto.net/kredit" title="[^"]*?GB = ([0-9.]+) MB"' @@ -28,11 +28,16 @@ class UlozTo(Account): return {"validuntil": -1, "trafficleft": trafficleft} def login(self, user, data, req): - html = req.load('http://www.ulozto.net/login?do=loginForm-submit', post={ + login_page = req.load('http://www.ulozto.net/?do=web-login', decode=True) + action = re.findall('<form action="(.+?)"', login_page)[1].replace('&', '&') + token = re.search('_token_" value="(.+?)"', login_page).group(1) + + html = req.load('http://www.ulozto.net'+action, post={ + "_token_": token, "login": "Submit", "password": data['password'], "username": user }, decode=True) - if '<ul class="error">' in html: + if '<div class="flash error">' in html: self.wrongPassword() |