summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/MegaRapidCz.py
diff options
context:
space:
mode:
authorGravatar jansohn <jansohn@users.noreply.github.com> 2015-10-02 10:09:26 +0200
committerGravatar jansohn <jansohn@users.noreply.github.com> 2015-10-02 10:09:26 +0200
commit3a08656c5665f4b8db98744fb323e64b8630e084 (patch)
tree28f9f62ffc57888b76ca32540dbf5af3a4cfc8d0 /module/plugins/accounts/MegaRapidCz.py
parentMerge pull request #1 from pyload/stable (diff)
parent[Account] Improve parse_traffic method + code cosmetics (diff)
downloadpyload-3a08656c5665f4b8db98744fb323e64b8630e084.tar.xz
Merge pull request #2 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/accounts/MegaRapidCz.py')
-rw-r--r--module/plugins/accounts/MegaRapidCz.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py
index ce2d78994..050e3e4c6 100644
--- a/module/plugins/accounts/MegaRapidCz.py
+++ b/module/plugins/accounts/MegaRapidCz.py
@@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account
class MegaRapidCz(Account):
__name__ = "MegaRapidCz"
__type__ = "account"
- __version__ = "0.37"
+ __version__ = "0.39"
__status__ = "testing"
__description__ = """MegaRapid.cz account plugin"""
@@ -25,28 +25,27 @@ class MegaRapidCz(Account):
TRAFFIC_LEFT_PATTERN = r'<tr><td>Kredit</td><td>(.*?) GiB'
- def parse_info(self, user, password, data, req):
+ def grab_info(self, user, password, data):
htmll = self.load("http://megarapid.cz/mujucet/")
m = re.search(self.LIMITDL_PATTERN, htmll)
- if m:
- data = self.get_data(user)
+ if m is not None:
data['options']['limitDL'] = [int(m.group(1))]
m = re.search(self.VALID_UNTIL_PATTERN, htmll)
- if m:
+ if m is not None:
validuntil = time.mktime(time.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:
+ if m is not None:
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, password, data, req):
+ def signin(self, user, password, data):
html = self.load("http://megarapid.cz/prihlaseni/")
if "Heslo:" in html: