From 97d25752691aa561c29a91166fdd30302bef2db2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 00:54:03 +0200 Subject: [Account] parse_info -> grab_info --- 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 13edbbb44..99510f2ff 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -15,7 +15,7 @@ class FastixRu(Account): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def parse_info(self, user, password, data, req): + def grab_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'], @@ -43,4 +43,4 @@ class FastixRu(Account): data['api'] = api if "error_code" in html: - self.login_fail() + self.fail_login() -- cgit v1.2.3 From fb45ec44220201268f99b747831df717fa7a83f8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 16:31:48 +0200 Subject: [Account] Fix __version__ --- 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 99510f2ff..81135ad9d 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __status__ = "testing" __description__ = """Fastix account plugin""" -- cgit v1.2.3 From b55419b584a69e1616e1d1d161c918666d739831 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 23:25:35 +0200 Subject: [FastixRu] Fixup --- module/plugins/accounts/FastixRu.py | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 81135ad9d..31e7d8bca 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __status__ = "testing" __description__ = """Fastix account plugin""" @@ -15,10 +15,19 @@ class FastixRu(Account): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] + def grab_hosters(self, user, password, data, req): + html = self.load("http://fastix.ru/api_v2", + get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", + 'sub' : "allowed_sources"}) + host_list = json_loads(html) + host_list = host_list['allow'] + return host_list + + def grab_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'], + get={'apikey': data['apikey'], 'sub' : "getaccountdetails"})) points = html['points'] @@ -32,15 +41,13 @@ class FastixRu(Account): def login(self, user, password, data, req): - html = self.load("https://fastix.ru/api_v2/", - get={'sub' : "get_apikey", - 'email' : user, - 'password': password}) + api = json_loads(self.load("https://fastix.ru/api_v2/", + get={'sub' : "get_apikey", + 'email' : user, + 'password': password})) - api = json_loads(html) - api = api['apikey'] + if 'error' in api: + self.fail_login(api['error_txt']) - data['api'] = api - - if "error_code" in html: - self.fail_login() + else: + data['apikey'] = api['apikey'] -- cgit v1.2.3 From ec6e5dc7fcdcefee10e37d22473c9accae1104cf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 29 Sep 2015 20:05:07 +0200 Subject: Account class completely rewritten + plugins updated --- module/plugins/accounts/FastixRu.py | 9 ++++----- 1 file changed, 4 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 31e7d8bca..f48dfee5f 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" - __version__ = "0.07" + __version__ = "0.08" __status__ = "testing" __description__ = """Fastix account plugin""" @@ -15,7 +15,7 @@ class FastixRu(Account): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def grab_hosters(self, user, password, data, req): + def grab_hosters(self, user, password, data): html = self.load("http://fastix.ru/api_v2", get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", 'sub' : "allowed_sources"}) @@ -24,8 +24,7 @@ class FastixRu(Account): return host_list - def grab_info(self, user, password, data, req): - data = self.get_data(user) + def grab_info(self, user, password, data): html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['apikey'], 'sub' : "getaccountdetails"})) @@ -40,7 +39,7 @@ class FastixRu(Account): return account_info - def login(self, user, password, data, req): + def signin(self, user, password, data): api = json_loads(self.load("https://fastix.ru/api_v2/", get={'sub' : "get_apikey", 'email' : user, -- cgit v1.2.3 From 3b3a4bd889286777ba6a590a1f74cf3edae36a72 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 30 Sep 2015 00:30:53 +0200 Subject: Add __config__ to MultiAccount (and XFSAccount) based plugins --- module/plugins/accounts/FastixRu.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index f48dfee5f..83a02d76b 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -10,6 +10,10 @@ class FastixRu(Account): __version__ = "0.08" __status__ = "testing" + __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to use" , "all"), + ("mh_list" , "str" , "Hoster list (comma separated)", "" ), + ("mh_interval", "int" , "Reload interval in minutes" , 60 )] + __description__ = """Fastix account plugin""" __license__ = "GPLv3" __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] -- cgit v1.2.3