From 049298dbdbff33918454b03a3b072f418d47af97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Jun 2015 05:33:38 +0200 Subject: Use SSL when login account --- module/plugins/accounts/SimplyPremiumCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 8caf600f9..fb3eb2163 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -40,7 +40,7 @@ class SimplyPremiumCom(Account): def login(self, user, data, req): req.cj.setCookie("simply-premium.com", "lang", "EN") - html = req.load("http://www.simply-premium.com/login.php", + html = req.load("https://www.simply-premium.com/login.php", post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, decode=True) -- cgit v1.2.3 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/SimplyPremiumCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index fb3eb2163..5c87cbbfb 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Simply-Premium.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/SimplyPremiumCom.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 5c87cbbfb..053f2c33b 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -19,7 +19,7 @@ class SimplyPremiumCom(Account): validuntil = -1 trafficleft = None - json_data = req.load('http://www.simply-premium.com/api/user.php?format=json') + json_data = self.load('http://www.simply-premium.com/api/user.php?format=json', req=req) self.logDebug("JSON data: %s" % json_data) @@ -40,9 +40,8 @@ class SimplyPremiumCom(Account): def login(self, user, data, req): req.cj.setCookie("simply-premium.com", "lang", "EN") - html = req.load("https://www.simply-premium.com/login.php", - post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, - decode=True) + html = self.load("https://www.simply-premium.com/login.php", + post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, req=req) if 'logout' not in html: self.wrongPassword() -- 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/SimplyPremiumCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 053f2c33b..e030a7dd8 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -7,21 +7,21 @@ from module.plugins.internal.Account import Account class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Simply-Premium.com account plugin""" __license__ = "GPLv3" __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): premium = False validuntil = -1 trafficleft = None json_data = self.load('http://www.simply-premium.com/api/user.php?format=json', req=req) - self.logDebug("JSON data: %s" % json_data) + self.log_debug("JSON data: %s" % json_data) json_data = json_loads(json_data) @@ -44,4 +44,4 @@ class SimplyPremiumCom(Account): post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, req=req) if 'logout' not in html: - self.wrongPassword() + self.wrong_password() -- 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/SimplyPremiumCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index e030a7dd8..c9c6e2227 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -41,7 +41,8 @@ class SimplyPremiumCom(Account): req.cj.setCookie("simply-premium.com", "lang", "EN") html = self.load("https://www.simply-premium.com/login.php", - post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, req=req) + post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, + req=req) if 'logout' not in html: self.wrong_password() -- 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/SimplyPremiumCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index c9c6e2227..84b704f63 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -19,7 +19,7 @@ class SimplyPremiumCom(Account): validuntil = -1 trafficleft = None - json_data = self.load('http://www.simply-premium.com/api/user.php?format=json', req=req) + json_data = self.load('http://www.simply-premium.com/api/user.php?format=json') self.log_debug("JSON data: %s" % json_data) @@ -41,8 +41,7 @@ class SimplyPremiumCom(Account): req.cj.setCookie("simply-premium.com", "lang", "EN") html = self.load("https://www.simply-premium.com/login.php", - post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, - req=req) + post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}) if 'logout' not in html: self.wrong_password() -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/accounts/SimplyPremiumCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 84b704f63..858a8b525 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -34,7 +34,7 @@ class SimplyPremiumCom(Account): if 'remain_traffic' in json_data['result'] and json_data['result']['remain_traffic']: trafficleft = float(json_data['result']['remain_traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 - return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft} + return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft} def login(self, user, data, req): -- 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/SimplyPremiumCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 858a8b525..3216ecf62 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -8,6 +8,7 @@ class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" __version__ = "0.07" + __status__ = "stable" __description__ = """Simply-Premium.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/SimplyPremiumCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 3216ecf62..1486578a3 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -8,7 +8,7 @@ class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" __version__ = "0.07" - __status__ = "stable" + __status__ = "testing" __description__ = """Simply-Premium.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/SimplyPremiumCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 1486578a3..534a75be8 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -15,7 +15,7 @@ class SimplyPremiumCom(Account): __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False validuntil = -1 trafficleft = None @@ -38,11 +38,11 @@ class SimplyPremiumCom(Account): return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("simply-premium.com", "lang", "EN") html = self.load("https://www.simply-premium.com/login.php", - post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}) + post={'key': user} if not password else {'login_name': user, 'login_pass': password}) if 'logout' not in html: - self.wrong_password() + self.fail() -- 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/SimplyPremiumCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 534a75be8..f8b5ff50b 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -45,4 +45,4 @@ class SimplyPremiumCom(Account): post={'key': user} if not password else {'login_name': user, 'login_pass': password}) if 'logout' not in html: - self.fail() + self.login_fail() -- cgit v1.2.3 From e5ce0acf056dc96c40d5616ab6d2b82f998eefbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Aug 2015 00:37:57 +0200 Subject: Use set_cookie instead cj.setCookie --- module/plugins/accounts/SimplyPremiumCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/SimplyPremiumCom.py') diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index f8b5ff50b..a5c69f51c 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -2,12 +2,13 @@ from module.common.json_layer import json_loads from module.plugins.internal.Account import Account +from module.plugins.internal.Plugin import set_cookie class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" - __version__ = "0.07" + __version__ = "0.08" __status__ = "testing" __description__ = """Simply-Premium.com account plugin""" @@ -39,7 +40,7 @@ class SimplyPremiumCom(Account): def login(self, user, password, data, req): - req.cj.setCookie("simply-premium.com", "lang", "EN") + set_cookie(req.cj, "simply-premium.com", "lang", "EN") html = self.load("https://www.simply-premium.com/login.php", post={'key': user} if not password else {'login_name': user, 'login_pass': password}) -- cgit v1.2.3