diff options
author | rukasuzu <lbaran80@gmail.com> | 2015-01-17 20:07:52 +0100 |
---|---|---|
committer | rukasuzu <lbaran80@gmail.com> | 2015-01-17 20:07:52 +0100 |
commit | 3692522c1bfb896dc4f9abdfa391fd86e8470150 (patch) | |
tree | 3553326077666368d15a9d226081cab4a0c80316 /module/plugins/accounts | |
parent | [SimpleHoster] Fix https://github.com/pyload/pyload/issues/1045 (diff) | |
download | pyload-3692522c1bfb896dc4f9abdfa391fd86e8470150.tar.xz |
[CatShareNet] Added traffic left info
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/CatShareNet.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index 90cdfe013..6fac87ecb 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -24,6 +24,7 @@ class CatShareNet(Account): def loadAccountInfo(self, user, req): premium = False validuntil = -1 + trafficleft = -1 html = req.load("http://catshare.net/", decode=True) @@ -39,10 +40,13 @@ class CatShareNet(Account): expiredate = m.group(1) if "-" not in expiredate: validuntil = mktime(strptime(expiredate, "%d.%m.%Y")) + m = re.search(r'<a href="/premium">([0-9.]+ [kMG]B)', html) + if m: + trafficleft = int(self.parseTraffic(m.group(1))) except Exception: pass - return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} + return {'premium': premium, 'trafficleft': trafficleft, 'validuntil': validuntil} def login(self, user, data, req): |