diff options
Diffstat (limited to 'module/plugins/accounts/ShareonlineBiz.py')
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 70922b239..cdc4ebb63 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -23,34 +23,35 @@ import re class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" - __version__ = "0.22" + __version__ = "0.23" __type__ = "account" __description__ = """share-online.biz account plugin""" __author_name__ = ("mkaay", "zoidberg") __author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz") - info_threshold = 60 - + def getUserAPI(self, user, req): + return req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (user, self.accounts[user]["password"])) + def loadAccountInfo(self, user, req): - src = req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (user, self.accounts[user]["password"])) + src = self.getUserAPI(user, req) info = {} for line in src.splitlines(): if "=" in line: key, value = line.split("=") info[key] = value - + self.logDebug(info) + if "dl" in info and info["dl"].lower() != "not_available": req.cj.setCookie("share-online.biz", "dl", info["dl"]) if "a" in info and info["a"].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info["a"]) + req.cj.setCookie("share-online.biz", "a", info["a"]) return {"validuntil": int(info["expire_date"]) if "expire_date" in info else -1, "trafficleft": -1, - "premium": True if ("dl" in info or "a" in info) and (info["group"] == "Premium") else False} + "premium": True if ("dl" in info or "a" in info) and (info["group"] != "Sammler") else False} def login(self, user, data, req): - req.lastURL = "http://www.share-online.biz/" - req.load("https://www.share-online.biz/user/login", cookies=True, post={ - "user": user, - "pass": data["password"]}) + src = self.getUserAPI(user, req) + if "EXCEPTION" in src: + self.wrongPassword()
\ No newline at end of file |