diff options
author | mkaay <mkaay@mkaay.de> | 2011-02-03 23:44:18 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2011-02-03 23:44:18 +0100 |
commit | 706f19933b820de8b5bd92a345b984e1da4c929d (patch) | |
tree | b4fbe1aec52767064b603f6a9ac5d2e9b066e7b1 /module/plugins/accounts/ShareonlineBiz.py | |
parent | share-online.biz free account fix (diff) | |
download | pyload-706f19933b820de8b5bd92a345b984e1da4c929d.tar.xz |
share-online premium fix, please test
Diffstat (limited to 'module/plugins/accounts/ShareonlineBiz.py')
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index d872ba086..3ba646bdc 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -29,7 +29,23 @@ class ShareonlineBiz(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") + def getUserAPI(self, user): + req = self.getAccountRequest(user) + src = req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (user, self.accounts[user]["password"])) + info = {} + for line in src.splitlines(): + key, value = line.split("=") + info[key] = value + return info + def loadAccountInfo(self, user, req): + try: + info = self.getUserAPI(user) + return {"validuntil": int(info["expire_date"]), "trafficleft": -1, "premium": not info["group"] == "Sammler"} + except: + pass + + #fallback src = req.load("http://www.share-online.biz/members.php?setlang=en") validuntil = re.search(r'<td align="left"><b>Package Expire Date:</b></td>\s*<td align="left">(\d+/\d+/\d+)</td>', src) if validuntil: |