diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-02-09 12:19:31 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-02-09 12:19:31 +0100 |
commit | 727ffe0aaa733a23e3db1aa7ef6a7e2068f565c5 (patch) | |
tree | 26a6199caa154544ce23fd93a57c5841ff26a677 /module/plugins/accounts | |
parent | mega.co.nz hoster plugin (diff) | |
download | pyload-727ffe0aaa733a23e3db1aa7ef6a7e2068f565c5.tar.xz |
closed #764
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index cdc4ebb63..fe2b412db 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -18,39 +18,38 @@ """ from module.plugins.Account import Account -from time import strptime, mktime -import re class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" - __version__ = "0.23" + __version__ = "0.24" __type__ = "account" __description__ = """share-online.biz account plugin""" __author_name__ = ("mkaay", "zoidberg") __author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz") - + 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"])) + return req.load("http://api.share-online.biz/account.php", + {"username": user, "password": self.accounts[user]["password"], "act": "userDetails"}) def loadAccountInfo(self, user, req): 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"]) - - return {"validuntil": int(info["expire_date"]) if "expire_date" in info else -1, - "trafficleft": -1, + 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"] != "Sammler") else False} - + def login(self, user, data, req): src = self.getUserAPI(user, req) if "EXCEPTION" in src: |