From 3639af423fab5d905e9222f0125aeea2dcf58118 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 01:17:16 +0100 Subject: [RapiduNet] Account trafficleft --- module/plugins/accounts/RapiduNet.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 2d4770f67..8da698c57 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -11,7 +11,7 @@ from module.common.json_layer import json_loads class RapiduNet(Account): __name__ = "RapiduNet" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Rapidu.net account plugin""" __license__ = "GPLv3" @@ -23,6 +23,8 @@ class RapiduNet(Account): VALID_UNTIL_PATTERN = r'>Account: \w+ \((\d+)' + TRAFFIC_LEFT_PATTERN = r'class="tipsyS">(.+?)<' + def loadAccountInfo(self, user, req): validuntil = None @@ -38,6 +40,10 @@ class RapiduNet(Account): if m: validuntil = time() + (86400 * int(m.group(1))) + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + trafficleft = self.parseTraffic(m.group(1)) + return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -- cgit v1.2.3