diff options
author | 2015-09-26 18:24:29 +0200 | |
---|---|---|
committer | 2015-09-26 18:24:29 +0200 | |
commit | 93a0c1d930520c055eae766b5dad305111a02c4d (patch) | |
tree | 8ac3f9e6dcf682775f5b170f2a9ca40eb7c0f8fc /module/plugins/accounts/FastixRu.py | |
parent | Spare plugin updates (diff) | |
parent | Merge pull request #1850 from chaosblog/patch-2 (diff) | |
download | pyload-93a0c1d930520c055eae766b5dad305111a02c4d.tar.xz |
Merge pull request #1 from pyload/stable
Merge actual version
Diffstat (limited to 'module/plugins/accounts/FastixRu.py')
-rw-r--r-- | module/plugins/accounts/FastixRu.py | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 13edbbb44..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.05" + __version__ = "0.07" __status__ = "testing" __description__ = """Fastix account plugin""" @@ -15,10 +15,19 @@ class FastixRu(Account): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def parse_info(self, user, password, data, req): + 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.login_fail() + else: + data['apikey'] = api['apikey'] |