diff options
-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() |