diff options
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/BitshareCom.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/HotfileCom.py | 28 | ||||
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 23 |
3 files changed, 31 insertions, 26 deletions
diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index b0cd1efcd..a4f56e31c 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -21,7 +21,7 @@ from module.plugins.Account import Account class BitshareCom(Account): __name__ = "BitshareCom" - __version__ = "0.1" + __version__ = "0.11" __type__ = "account" __description__ = """Bitshare account plugin""" __author_name__ = ("Paul King") @@ -39,6 +39,6 @@ class BitshareCom(Account): def login(self, user, data, req): - page = req.load("http://bitshare.com/login.html", post={ "user" : user, "pass" : data["password"], "submit" :"1"}, cookies=True) - if "Wrong Username or Password" in page: + page = req.load("http://bitshare.com/login.html", post={ "user" : user, "password" : data["password"], "submit" :"Login"}, cookies=True) + if "login" in req.lastEffectiveURL: self.wrongPassword() diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py index 9b54e6a3c..23e42dacf 100644 --- a/module/plugins/accounts/HotfileCom.py +++ b/module/plugins/accounts/HotfileCom.py @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. - @author: mkaay + @author: mkaay, JoKoT3 """ from module.plugins.Account import Account @@ -23,11 +23,11 @@ import hashlib class HotfileCom(Account): __name__ = "HotfileCom" - __version__ = "0.1" + __version__ = "0.2" __type__ = "account" __description__ = """hotfile.com account plugin""" - __author_name__ = ("mkaay") - __author_mail__ = ("mkaay@mkaay.de") + __author_name__ = ("mkaay","JoKoT3") + __author_mail__ = ("mkaay@mkaay.de","jokot3@gmail.com") def loadAccountInfo(self, user, req): resp = self.apiCall("getuserinfo", user=user) @@ -39,14 +39,18 @@ class HotfileCom(Account): key, value = p.split("=") info[key] = value - info["premium_until"] = info["premium_until"].replace("T"," ") - zone = info["premium_until"][19:] - info["premium_until"] = info["premium_until"][:19] - zone = int(zone[:3]) + if info['is_premium'] == '1': + info["premium_until"] = info["premium_until"].replace("T"," ") + zone = info["premium_until"][19:] + info["premium_until"] = info["premium_until"][:19] + zone = int(zone[:3]) + + validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone*3600) + tmp = {"validuntil":validuntil, "trafficleft":-1, "premium":True} - validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone*3600) - - tmp = {"validuntil":validuntil, "trafficleft":-1} + elif info['is_premium'] == '0': + tmp = {"premium":False} + return tmp def apiCall(self, method, post={}, user=None): @@ -79,4 +83,4 @@ class HotfileCom(Account): page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data["password"]}, cookies=True) if "Bad username/password" in page: - self.wrongPassword() + self.wrongPassword()
\ No newline at end of file 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 |