diff options
Diffstat (limited to 'module/plugins/accounts/MultishareCz.py')
-rw-r--r-- | module/plugins/accounts/MultishareCz.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index 3488e3288..c9e30a93f 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -2,13 +2,14 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class MultishareCz(Account): __name__ = "MultishareCz" __type__ = "account" - __version__ = "0.05" + __version__ = "0.07" + __status__ = "testing" __description__ = """Multishare.cz account plugin""" __license__ = "GPLv3" @@ -19,26 +20,25 @@ class MultishareCz(Account): ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name=".+?" value="(.+?)">' - def loadAccountInfo(self, user, req): - #self.relogin(user) - html = req.load("http://www.multishare.cz/profil/", decode=True) + def parse_info(self, user, password, data, req): + # self.relogin(user) + html = self.load("http://www.multishare.cz/profil/") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - trafficleft = self.parseTraffic(m.group('S') + m.group('U')) if m else 0 + trafficleft = self.parse_traffic(m.group('S') + m.group('U')) if m else 0 self.premium = True if trafficleft else False - html = req.load("http://www.multishare.cz/", decode=True) + html = self.load("http://www.multishare.cz/") mms_info = dict(re.findall(self.ACCOUNT_INFO_PATTERN, html)) - return dict(mms_info, **{"validuntil": -1, "trafficleft": trafficleft}) + return dict(mms_info, **{'validuntil': -1, 'trafficleft': trafficleft}) - def login(self, user, data, req): - html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', - post={"akce" : "Přihlásit", - "heslo": data['password'], - "jmeno": user}, - decode=True) + def login(self, user, password, data, req): + html = self.load('https://www.multishare.cz/html/prihlaseni_process.php', + post={'akce' : "Přihlásit", + 'heslo': password, + 'jmeno': user}) if '<div class="akce-chyba akce">' in html: - self.wrongPassword() + self.login_fail() |