summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/OboomCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/OboomCom.py')
-rw-r--r--module/plugins/accounts/OboomCom.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py
index 19fcea67a..a37759f9a 100644
--- a/module/plugins/accounts/OboomCom.py
+++ b/module/plugins/accounts/OboomCom.py
@@ -2,21 +2,24 @@
import time
-from module.plugins.Account import Account
from module.lib.beaker.crypto.pbkdf2 import PBKDF2
+
from module.common.json_layer import json_loads
+from module.plugins.Account import Account
class OboomCom(Account):
__name__ = "OboomCom"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Oboom.com account plugin"""
__author_name__ = "stanley"
__author_mail__ = "stanley.foerster@gmail.com"
+
def loadAccountData(self, user, req):
- passwd = self.getAccountData(user)["password"]
+ 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}))
@@ -27,17 +30,17 @@ class OboomCom(Account):
def loadAccountInfo(self, name, req):
accountData = self.loadAccountData(name, req)
- userData = accountData["user"]
+ userData = accountData['user']
if "premium_unix" in userData:
- validUntilUtc = int(userData["premium_unix"])
+ 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"]
+ traffic = userData['traffic']
+ trafficLeft = traffic['current']
+ maxTraffic = traffic['max']
+ session = accountData['session']
return {"premium": premium,
"validuntil": validUntil,
"trafficleft": trafficLeft / 1024,