diff options
Diffstat (limited to 'module/plugins/accounts/FastshareCz.py')
-rw-r--r-- | module/plugins/accounts/FastshareCz.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index b946e29ba..3a3769a1c 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -2,13 +2,15 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account +from module.plugins.internal.Plugin import set_cookie class FastshareCz(Account): __name__ = "FastshareCz" __type__ = "account" - __version__ = "0.06" + __version__ = "0.09" + __status__ = "testing" __description__ = """Fastshare.cz account plugin""" __license__ = "GPLv3" @@ -19,16 +21,16 @@ class FastshareCz(Account): CREDIT_PATTERN = r'Credit\s*:\s*</td>\s*<td>(.+?)\s*<' - def loadAccountInfo(self, user, req): + def parse_info(self, user, password, data, req): validuntil = -1 trafficleft = None premium = False - html = req.load("http://www.fastshare.cz/user", decode=True) + html = self.load("http://www.fastshare.cz/user") m = re.search(self.CREDIT_PATTERN, html) if m: - trafficleft = self.parseTraffic(m.group(1)) + trafficleft = self.parse_traffic(m.group(1)) premium = bool(trafficleft) @@ -37,14 +39,14 @@ class FastshareCz(Account): 'premium' : premium} - def login(self, user, data, req): - req.cj.setCookie("fastshare.cz", "lang", "en") + def login(self, user, password, data, req): + set_cookie(req.cj, "fastshare.cz", "lang", "en") - req.load('http://www.fastshare.cz/login') # Do not remove or it will not login + self.load('http://www.fastshare.cz/login') #@NOTE: Do not remove or it will not login - html = req.load("http://www.fastshare.cz/sql.php", - post={'login': user, 'heslo': data['password']}, - decode=True) + html = self.load("https://www.fastshare.cz/sql.php", + post={'login': user, + 'heslo': password}) if ">Wrong username or password" in html: - self.wrongPassword() + self.login_fail() |