diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-20 18:43:15 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-27 22:46:01 +0100 |
commit | 5deded62d94c04be64d34f6b67d07803eea9b6bf (patch) | |
tree | a33f82a6208b3a922bf5e1883f134a1fb86a9217 /module/plugins/accounts/FastixRu.py | |
parent | Update addons (diff) | |
download | pyload-5deded62d94c04be64d34f6b67d07803eea9b6bf.tar.xz |
Spare code cosmetics
Diffstat (limited to 'module/plugins/accounts/FastixRu.py')
-rw-r--r-- | module/plugins/accounts/FastixRu.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 33f7eeae9..d28cc830b 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -21,19 +21,20 @@ class FastixRu(MultiAccount): def grab_hosters(self, user, password, data): html = self.load("http://fastix.ru/api_v2", - get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", - 'sub' : "allowed_sources"}) + 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): - html = json.loads(self.load("http://fastix.ru/api_v2/", - get={'apikey': data['apikey'], - 'sub' : "getaccountdetails"})) + html = self.load("http://fastix.ru/api_v2/", + get={'apikey': data['apikey'], + 'sub' : "getaccountdetails"}) + json_data = json.loads(html) - points = html['points'] + points = json_data['points'] kb = float(points) * 1024 ** 2 / 1000 if points > 0: @@ -44,10 +45,11 @@ class FastixRu(MultiAccount): def signin(self, user, password, data): - api = json.loads(self.load("https://fastix.ru/api_v2/", - get={'sub' : "get_apikey", - 'email' : user, - 'password': password})) + html = self.load("https://fastix.ru/api_v2/", + get={'sub' : "get_apikey", + 'email' : user, + 'password': password}) + api = json.loads(html) if 'error' in api: self.fail_login(api['error_txt']) |