diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-05 13:32:36 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-05 13:32:36 +0200 |
commit | d1e2da48ff1158c84bab62aba3e62ff16f24f124 (patch) | |
tree | 14c2b461b84ab1c07ab39fbe3a80aa69c7b4c8ef /pyload/plugins/account/OboomCom.py | |
parent | Fix refs on hook plugins + add missing __init__ files (diff) | |
parent | Remove old Ev0InFetcher hook (diff) | |
download | pyload-d1e2da48ff1158c84bab62aba3e62ff16f24f124.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
module/plugins/internal/CaptchaService.py
pyload/plugins/account/CyberlockerCh.py
pyload/plugins/account/EgoFilesCom.py
pyload/plugins/account/HotfileCom.py
pyload/plugins/crypter/HotfileFolderCom.py
pyload/plugins/crypter/LinkSaveIn.py
pyload/plugins/crypter/OneKhDe.py
pyload/plugins/hoster/EgoFilesCom.py
pyload/plugins/internal/XFSPAccount.py
Diffstat (limited to 'pyload/plugins/account/OboomCom.py')
-rw-r--r-- | pyload/plugins/account/OboomCom.py | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/pyload/plugins/account/OboomCom.py b/pyload/plugins/account/OboomCom.py index 14bdd1510..b304e210c 100644 --- a/pyload/plugins/account/OboomCom.py +++ b/pyload/plugins/account/OboomCom.py @@ -11,7 +11,7 @@ from pyload.plugins.base.Account import Account class OboomCom(Account): __name__ = "OboomCom" __type__ = "account" - __version__ = "0.1" + __version__ = "0.2" __description__ = """Oboom.com account plugin""" __author_name__ = "stanley" @@ -22,32 +22,41 @@ class OboomCom(Account): passwd = self.getAccountData(user)['password'] salt = passwd[::-1] pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) - result = json_loads(req.load("https://www.oboom.com/1.0/login", get={"auth": user, "pass": pbkdf2})) + result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2})) if not result[0] == 200: self.logWarning("Failed to log in: %s" % result[1]) self.wrongPassword() return result[1] + def loadAccountInfo(self, name, req): accountData = self.loadAccountData(name, req) + userData = accountData['user'] - if "premium_unix" in userData: - validUntilUtc = int(userData['premium_unix']) - if validUntilUtc > int(time.time()): - premium = True - validUntil = validUntilUtc - traffic = userData['traffic'] - trafficLeft = traffic['current'] - maxTraffic = traffic['max'] - session = accountData['session'] - return {"premium": premium, - "validuntil": validUntil, - "trafficleft": trafficLeft / 1024, - "maxtraffic": maxTraffic / 1024, - "session": session - } - return {"premium": False, "validuntil": -1} + if userData['premium'] == "null": + premium = False + else: + premium = True + + if userData['premium_unix'] == "null": + validUntil = -1 + else: + validUntil = int(userData['premium_unix']) + + traffic = userData['traffic'] + + trafficLeft = traffic['current'] + maxTraffic = traffic['max'] + + session = accountData['session'] + + return {'premium': premium, + 'validuntil': validUntil, + 'trafficleft': trafficLeft / 1024, + 'maxtraffic': maxTraffic / 1024, + 'session': session} + def login(self, user, data, req): self.loadAccountData(user, req) |