From 8e7d14bae4d3c836f029a1235eb227380acc3f75 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 16 Feb 2015 21:59:10 +0100 Subject: Fix plugins to work on 0.4.10 --- module/plugins/accounts/MegaRapidCz.py | 60 ---------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 module/plugins/accounts/MegaRapidCz.py (limited to 'module/plugins/accounts/MegaRapidCz.py') diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py deleted file mode 100644 index 5596fd623..000000000 --- a/module/plugins/accounts/MegaRapidCz.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import mktime, strptime -from pyload.plugin.Account import Account - - -class MegaRapidCz(Account): - __name__ = "MegaRapidCz" - __type__ = "account" - __version__ = "0.35" - - __description__ = """MegaRapid.cz account plugin""" - __license__ = "GPLv3" - __authors__ = [("MikyWoW", "mikywow@seznam.cz"), - ("zoidberg", "zoidberg@mujmail.cz")] - - - login_timeout = 60 - - LIMITDL_PATTERN = ur'Max. počet paralelních stahování: (\d+)' - VALID_UNTIL_PATTERN = ur'Paušální stahování aktivní. Vyprší (.*?)' - TRAFFIC_LEFT_PATTERN = r'Kredit(.*?) GiB' - - - def loadAccountInfo(self, user, req): - htmll = req.load("http://megarapid.cz/mujucet/", decode=True) - - m = re.search(self.LIMITDL_PATTERN, htmll) - if m: - data = self.getAccountData(user) - data['options']['limitDL'] = [int(m.group(1))] - - m = re.search(self.VALID_UNTIL_PATTERN, htmll) - if m: - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) - 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": False, "trafficleft": None, "validuntil": None} - - - def login(self, user, data, req): - html = req.load("http://megarapid.cz/prihlaseni/", decode=True) - - 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"}) -- cgit v1.2.3