diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-24 17:16:34 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-24 17:16:34 +0100 |
commit | 3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a (patch) | |
tree | b01e2c881aaf744aaab0af613a7a26e7129f2028 /module/plugins/accounts/ShareonlineBiz.py | |
parent | enter captchas on webui (diff) | |
parent | Rapidgator: fixed bug #47 (diff) | |
download | pyload-3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a.tar.xz |
Merge remote-tracking branch 'origin/stable'
Conflicts:
module/plugins/accounts/FilesonicCom.py
module/plugins/accounts/OronCom.py
module/plugins/accounts/ShareonlineBiz.py
module/plugins/addons/UpdateManager.py
module/plugins/crypter/FilesonicComFolder.py
module/plugins/hoster/BezvadataCz.py
module/plugins/hoster/EuroshareEu.py
module/plugins/hoster/FilesonicCom.py
module/plugins/hoster/MegauploadCom.py
module/plugins/hoster/Premium4Me.py
module/plugins/hoster/YoutubeCom.py
module/plugins/internal/MultiHoster.py
module/utils.py
Diffstat (limited to 'module/plugins/accounts/ShareonlineBiz.py')
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 73 |
1 files changed, 27 insertions, 46 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 4dd398d6d..fe2b412db 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -18,58 +18,39 @@ """ from module.plugins.Account import Account -from time import strptime, mktime -import re class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" - __version__ = "0.3" + __version__ = "0.24" __type__ = "account" __description__ = """share-online.biz account plugin""" - __author_name__ = ("mkaay") - __author_mail__ = ("mkaay@mkaay.de") - - def getUserAPI(self, req): - src = req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (self.loginname, self.password)) + __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": user, "password": self.accounts[user]["password"], "act": "userDetails"}) + + def loadAccountInfo(self, user, req): + src = self.getUserAPI(user, req) + info = {} for line in src.splitlines(): - key, value = line.split("=") - info[key] = value - return info - - def loadAccountInfo(self, user, req): - try: - info = self.getUserAPI(req) - 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: - validuntil = int(mktime(strptime(validuntil.group(1), "%m/%d/%y"))) - else: - validuntil = -1 - - acctype = re.search(r'<td align="left" ><b>Your Package:</b></td>\s*<td align="left">\s*<b>(.*?)</b>\s*</td>', src) - if acctype: - if acctype.group(1) == "Collector account (free)": - premium = False - else: - premium = True + 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, + "premium": True if ("dl" in info or "a" in info) and (info["group"] != "Sammler") else False} - tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": premium} - return tmp - def login(self, user, data, req): - post_vars = { - "act": "login", - "location": "index.php", - "dieseid": "", - "user": user, - "pass": data["password"], - "login": "Login" - } - req.lastURL = "http://www.share-online.biz/" - req.load("https://www.share-online.biz/login.php", cookies=True, post=post_vars) + src = self.getUserAPI(user, req) + if "EXCEPTION" in src: + self.wrongPassword()
\ No newline at end of file |