diff options
Diffstat (limited to 'module/plugins/accounts/MegaRapidCz.py')
-rw-r--r-- | module/plugins/accounts/MegaRapidCz.py | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py index 262d5a818..ce2d78994 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -3,13 +3,14 @@ import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class MegaRapidCz(Account): __name__ = "MegaRapidCz" __type__ = "account" - __version__ = "0.35" + __version__ = "0.37" + __status__ = "testing" __description__ = """MegaRapid.cz account plugin""" __license__ = "GPLv3" @@ -24,37 +25,37 @@ class MegaRapidCz(Account): TRAFFIC_LEFT_PATTERN = r'<tr><td>Kredit</td><td>(.*?) GiB' - def loadAccountInfo(self, user, req): - htmll = req.load("http://megarapid.cz/mujucet/", decode=True) + def parse_info(self, user, password, data, req): + htmll = self.load("http://megarapid.cz/mujucet/") m = re.search(self.LIMITDL_PATTERN, htmll) if m: - data = self.getAccountData(user) + data = self.get_data(user) data['options']['limitDL'] = [int(m.group(1))] m = re.search(self.VALID_UNTIL_PATTERN, htmll) if m: validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y - %H:%M")) - return {"premium": True, "trafficleft": -1, "validuntil": validuntil} + return {'premium': True, 'trafficleft': -1, 'validuntil': validuntil} m = re.search(self.TRAFFIC_LEFT_PATTERN, htmll) if m: trafficleft = float(m.group(1)) * (1 << 20) - return {"premium": True, "trafficleft": trafficleft, "validuntil": -1} + return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1} - return {"premium": False, "trafficleft": None, "validuntil": None} + return {'premium': False, 'trafficleft': None, 'validuntil': None} - def login(self, user, data, req): - html = req.load("http://megarapid.cz/prihlaseni/", decode=True) + def login(self, user, password, data, req): + html = self.load("http://megarapid.cz/prihlaseni/") if "Heslo:" in html: start = html.index('id="inp_hash" name="hash" value="') html = html[start + 33:] hashes = html[0:32] - html = req.load("http://megarapid.cz/prihlaseni/", - post={"hash": hashes, - "login": user, - "pass1": data['password'], - "remember": 0, - "sbmt": u"Přihlásit"}) + html = self.load("https://megarapid.cz/prihlaseni/", + post={'hash' : hashes, + 'login' : user, + 'pass1' : password, + 'remember': 1, + 'sbmt' : u"Přihlásit"}) |