summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar rukasuzu <lbaran80@gmail.com> 2015-01-17 20:07:52 +0100
committerGravatar rukasuzu <lbaran80@gmail.com> 2015-01-17 20:07:52 +0100
commit3692522c1bfb896dc4f9abdfa391fd86e8470150 (patch)
tree3553326077666368d15a9d226081cab4a0c80316 /module
parent[SimpleHoster] Fix https://github.com/pyload/pyload/issues/1045 (diff)
downloadpyload-3692522c1bfb896dc4f9abdfa391fd86e8470150.tar.xz
[CatShareNet] Added traffic left info
Diffstat (limited to 'module')
-rw-r--r--module/plugins/accounts/CatShareNet.py6
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):