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/FastixRu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 51be3880f..0e5b28309 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -29,7 +29,7 @@ class FastixRu(Account): def login(self, user, data, req): - html = req.load("http://fastix.ru/api_v2/", + html = req.load("https://fastix.ru/api_v2/", get={'sub': "get_apikey", 'email': user, 'password': data['password']}) api = json_loads(html) -- 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/FastixRu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 0e5b28309..c83964feb 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Fastix 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/FastixRu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index c83964feb..dedbc0d5d 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -16,7 +16,7 @@ class FastixRu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - html = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) + html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"}), req=req) points = html['points'] kb = float(points) * 1024 ** 2 / 1000 @@ -29,8 +29,8 @@ class FastixRu(Account): def login(self, user, data, req): - html = req.load("https://fastix.ru/api_v2/", - get={'sub': "get_apikey", 'email': user, 'password': data['password']}) + html = self.load("https://fastix.ru/api_v2/", + get={'sub': "get_apikey", 'email': user, 'password': data['password']}, req=req) api = json_loads(html) api = api['apikey'] -- 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/FastixRu.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index dedbc0d5d..eaf12619a 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -7,15 +7,15 @@ from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Fastix account plugin""" __license__ = "GPLv3" __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def loadAccountInfo(self, user, req): - data = self.getAccountData(user) + def load_account_info(self, user, req): + data = self.get_account_data(user) html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"}), req=req) points = html['points'] @@ -38,4 +38,4 @@ class FastixRu(Account): data['api'] = api if "error_code" 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/FastixRu.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index eaf12619a..d8c992bb3 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -16,7 +16,10 @@ class FastixRu(Account): def load_account_info(self, user, req): data = self.get_account_data(user) - html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"}), req=req) + html = json_loads(self.load("http://fastix.ru/api_v2/", + get={'apikey': data['api'], + 'sub' : "getaccountdetails"}), + req=req) points = html['points'] kb = float(points) * 1024 ** 2 / 1000 @@ -30,7 +33,10 @@ class FastixRu(Account): def login(self, user, data, req): html = self.load("https://fastix.ru/api_v2/", - get={'sub': "get_apikey", 'email': user, 'password': data['password']}, req=req) + get={'sub' : "get_apikey", + 'email' : user, + 'password': data['password']}, + req=req) api = json_loads(html) api = api['apikey'] -- 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/FastixRu.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index d8c992bb3..1fe93fb14 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -18,8 +18,7 @@ class FastixRu(Account): data = self.get_account_data(user) html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], - 'sub' : "getaccountdetails"}), - req=req) + 'sub' : "getaccountdetails"})) points = html['points'] kb = float(points) * 1024 ** 2 / 1000 @@ -35,8 +34,7 @@ class FastixRu(Account): html = self.load("https://fastix.ru/api_v2/", get={'sub' : "get_apikey", 'email' : user, - 'password': data['password']}, - req=req) + 'password': data['password']}) api = json_loads(html) api = api['apikey'] -- 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/FastixRu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 1fe93fb14..789fa9e04 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -24,9 +24,9 @@ class FastixRu(Account): kb = float(points) * 1024 ** 2 / 1000 if points > 0: - account_info = {"validuntil": -1, "trafficleft": kb} + account_info = {'validuntil': -1, 'trafficleft': kb} else: - account_info = {"validuntil": None, "trafficleft": None, "premium": False} + account_info = {'validuntil': None, 'trafficleft': None, 'premium': False} return account_info -- 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/FastixRu.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 789fa9e04..bd6fd5b20 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -8,6 +8,7 @@ class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" __version__ = "0.05" + __status__ = "stable" __description__ = """Fastix 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/FastixRu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index bd6fd5b20..dc18290a5 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -8,7 +8,7 @@ class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" __version__ = "0.05" - __status__ = "stable" + __status__ = "testing" __description__ = """Fastix 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/FastixRu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index dc18290a5..91608c2ae 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -15,8 +15,8 @@ class FastixRu(Account): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub' : "getaccountdetails"})) @@ -31,11 +31,11 @@ class FastixRu(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://fastix.ru/api_v2/", get={'sub' : "get_apikey", 'email' : user, - 'password': data['password']}) + 'password': password}) api = json_loads(html) api = api['apikey'] @@ -43,4 +43,4 @@ class FastixRu(Account): data['api'] = api if "error_code" 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/FastixRu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 91608c2ae..13edbbb44 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -43,4 +43,4 @@ class FastixRu(Account): data['api'] = api if "error_code" in html: - self.fail() + self.login_fail() -- cgit v1.2.3