summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar pulpe <Pulpan3@gmail.com> 2013-09-22 12:26:20 +0200
committerGravatar pulpe <Pulpan3@gmail.com> 2013-09-22 12:26:20 +0200
commit5fc81f3d70276dd0d2345de83495c9e223efd2c3 (patch)
tree4fcf15b8d07d114bc74318557f0fb1ad0d594a25 /module
parentRemoved SkipRev. See #167 (diff)
downloadpyload-5fc81f3d70276dd0d2345de83495c9e223efd2c3.tar.xz
UlozTo account fix
Diffstat (limited to 'module')
-rw-r--r--module/plugins/accounts/UlozTo.py13
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('&amp;', '&')
+ 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()