From 706f19933b820de8b5bd92a345b984e1da4c929d Mon Sep 17 00:00:00 2001 From: mkaay Date: Thu, 3 Feb 2011 23:44:18 +0100 Subject: share-online premium fix, please test --- module/plugins/accounts/ShareonlineBiz.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'module/plugins/accounts/ShareonlineBiz.py') 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'Package Expire Date:\s*(\d+/\d+/\d+)', src) if validuntil: -- cgit v1.2.3