From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/accounts/SmoozedCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 1c303331b..b51e5cef3 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -20,13 +20,13 @@ except ImportError: return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from module.common.json_layer import json_loads -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class SmoozedCom(Account): __name__ = "SmoozedCom" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Smoozed.com account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/accounts/SmoozedCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index b51e5cef3..da81a6b80 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -74,5 +74,5 @@ class SmoozedCom(Account): salt = hashlib.sha256(password).hexdigest() encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) - return json_loads(req.load("http://www2.smoozed.com/api/login", - get={'auth': user, 'password': encrypted})) + return json_loads(self.load("http://www2.smoozed.com/api/login", + get={'auth': user, 'password': encrypted}, req=req)) -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/accounts/SmoozedCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index da81a6b80..148818957 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -43,7 +43,7 @@ class SmoozedCom(Account): 'trafficleft': None, 'premium' : False} else: - # Parse account info + #: Parse account info info = {'validuntil' : float(status["data"]["user"]["user_premium"]), 'trafficleft': max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]), 'session' : status["data"]["session_key"], @@ -61,10 +61,10 @@ class SmoozedCom(Account): def login(self, user, data, req): - # Get user data from premiumize.me + #: Get user data from premiumize.me status = self.getAccountStatus(user, req) - # Check if user and password are valid + #: Check if user and password are valid if status['state'] != 'ok': self.wrongPassword() -- cgit v1.2.3 From 9305859b64a2f0aef3f27fb7e5b75caa0cb836a6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 19:24:49 +0200 Subject: Spare code cosmetics (3) --- module/plugins/accounts/SmoozedCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 148818957..0b0d7ed74 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -44,13 +44,13 @@ class SmoozedCom(Account): 'premium' : False} else: #: Parse account info - info = {'validuntil' : float(status["data"]["user"]["user_premium"]), - 'trafficleft': max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]), - 'session' : status["data"]["session_key"], - 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]} + info = {'validuntil' : float(status['data']['user']['user_premium']), + 'trafficleft': max(0, status['data']['traffic'][1] - status['data']['traffic'][0]), + 'session' : status['data']['session_key'], + 'hosters' : [hoster['name'] for hoster in status['data']['hoster']]} if info['validuntil'] < time.time(): - if float(status["data"]["user"].get("user_trial", 0)) > time.time(): + if float(status['data']['user'].get("user_trial", 0)) > time.time(): info['premium'] = True else: info['premium'] = False -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/accounts/SmoozedCom.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 0b0d7ed74..853963c4a 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -26,17 +26,17 @@ from module.plugins.internal.Account import Account class SmoozedCom(Account): __name__ = "SmoozedCom" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Smoozed.com account plugin""" __license__ = "GPLv3" __authors__ = [("", "")] - def loadAccountInfo(self, user, req): - status = self.getAccountStatus(user, req) + def load_account_info(self, user, req): + status = self.get_account_status(user, req) - self.logDebug(status) + self.log_debug(status) if status['state'] != 'ok': info = {'validuntil' : None, @@ -62,15 +62,15 @@ class SmoozedCom(Account): def login(self, user, data, req): #: Get user data from premiumize.me - status = self.getAccountStatus(user, req) + status = self.get_account_status(user, req) #: Check if user and password are valid if status['state'] != 'ok': - self.wrongPassword() + self.wrong_password() - def getAccountStatus(self, user, req): - password = self.getAccountData(user)['password'] + def get_account_status(self, user, req): + password = self.get_account_data(user)['password'] salt = hashlib.sha256(password).hexdigest() encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/accounts/SmoozedCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 853963c4a..a13bd14a8 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -75,4 +75,6 @@ class SmoozedCom(Account): encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) return json_loads(self.load("http://www2.smoozed.com/api/login", - get={'auth': user, 'password': encrypted}, req=req)) + get={'auth': user, + 'password': encrypted}, + req=req)) -- cgit v1.2.3 From 1f5a55ae2133a782bdcca334ecbcdbde50dbcf99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 15:29:48 +0200 Subject: No more need to use the req argument when call load method --- module/plugins/accounts/SmoozedCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index a13bd14a8..cb3c7b1a3 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -76,5 +76,4 @@ class SmoozedCom(Account): return json_loads(self.load("http://www2.smoozed.com/api/login", get={'auth': user, - 'password': encrypted}, - req=req)) + 'password': encrypted})) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/accounts/SmoozedCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index cb3c7b1a3..8952a0149 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -27,6 +27,7 @@ class SmoozedCom(Account): __name__ = "SmoozedCom" __type__ = "account" __version__ = "0.07" + __status__ = "stable" __description__ = """Smoozed.com account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/accounts/SmoozedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 8952a0149..f3f33eff6 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -27,7 +27,7 @@ class SmoozedCom(Account): __name__ = "SmoozedCom" __type__ = "account" __version__ = "0.07" - __status__ = "stable" + __status__ = "testing" __description__ = """Smoozed.com account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/accounts/SmoozedCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index f3f33eff6..2201e4294 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -34,7 +34,7 @@ class SmoozedCom(Account): __authors__ = [("", "")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): status = self.get_account_status(user, req) self.log_debug(status) @@ -61,17 +61,17 @@ class SmoozedCom(Account): return info - def login(self, user, data, req): + def login(self, user, password, data, req): #: Get user data from premiumize.me status = self.get_account_status(user, req) #: Check if user and password are valid if status['state'] != 'ok': - self.wrong_password() + self.fail() def get_account_status(self, user, req): - password = self.get_account_data(user)['password'] + password = self.get_data(user)['password'] salt = hashlib.sha256(password).hexdigest() encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/accounts/SmoozedCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/SmoozedCom.py') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 2201e4294..9c2451794 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -35,7 +35,7 @@ class SmoozedCom(Account): def parse_info(self, user, password, data, req): - status = self.get_account_status(user, req) + status = self.get_account_status(user, password, req) self.log_debug(status) @@ -63,15 +63,15 @@ class SmoozedCom(Account): def login(self, user, password, data, req): #: Get user data from premiumize.me - status = self.get_account_status(user, req) + status = self.get_account_status(user, password, req) #: Check if user and password are valid if status['state'] != 'ok': - self.fail() + self.login_fail() - def get_account_status(self, user, req): - password = self.get_data(user)['password'] + def get_account_status(self, user, password, req): + password = password salt = hashlib.sha256(password).hexdigest() encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) -- cgit v1.2.3