summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/UlozTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/UlozTo.py')
-rw-r--r--module/plugins/accounts/UlozTo.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py
index f95c8834b..00e125dbc 100644
--- a/module/plugins/accounts/UlozTo.py
+++ b/module/plugins/accounts/UlozTo.py
@@ -3,13 +3,14 @@
import re
import urlparse
-from module.plugins.Account import Account
+from module.plugins.internal.Account import Account
class UlozTo(Account):
__name__ = "UlozTo"
__type__ = "account"
- __version__ = "0.10"
+ __version__ = "0.12"
+ __status__ = "testing"
__description__ = """Uloz.to account plugin"""
__license__ = "GPLv3"
@@ -20,8 +21,8 @@ class UlozTo(Account):
TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a .*?title=".+?GB = ([\d.]+) MB"'
- def loadAccountInfo(self, user, req):
- html = req.load("http://www.ulozto.net/", decode=True)
+ def parse_info(self, user, password, data, req):
+ html = self.load("http://www.ulozto.net/")
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
@@ -31,19 +32,18 @@ class UlozTo(Account):
return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': premium}
- def login(self, user, data, req):
- login_page = req.load('http://www.ulozto.net/?do=web-login', decode=True)
+ def login(self, user, password, data, req):
+ login_page = self.load('http://www.ulozto.net/?do=web-login')
action = re.findall('<form action="(.+?)"', login_page)[1].replace('&amp;', '&')
token = re.search('_token_" value="(.+?)"', login_page).group(1)
- html = req.load(urlparse.urljoin("http://www.ulozto.net/", action),
- post={'_token_' : token,
- 'do' : "loginForm-submit",
- 'login' : u"Přihlásit",
- 'password': data['password'],
- 'username': user,
- 'remember': "on"},
- decode=True)
+ html = self.load(urlparse.urljoin("https://www.ulozto.net/", action),
+ post={'_token_' : token,
+ 'do' : "loginForm-submit",
+ 'login' : u"Přihlásit",
+ 'password': password,
+ 'username': user,
+ 'remember': "on"})
if '<div class="flash error">' in html:
- self.wrongPassword()
+ self.login_fail()