summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/FastixRu.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-07 00:27:18 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-07 00:27:18 +0100
commit67587fbe0335cacfde28a86ba729b9d567ce1da7 (patch)
tree090ea3a41894437ce619fe06304508479ace6ab6 /module/plugins/accounts/FastixRu.py
parentPlugin code cosmetics (2) (diff)
downloadpyload-67587fbe0335cacfde28a86ba729b9d567ce1da7.tar.xz
Plugin code cosmetics (3)
Diffstat (limited to 'module/plugins/accounts/FastixRu.py')
-rw-r--r--module/plugins/accounts/FastixRu.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py
index 049ee9f77..ced49125a 100644
--- a/module/plugins/accounts/FastixRu.py
+++ b/module/plugins/accounts/FastixRu.py
@@ -16,11 +16,11 @@ class FastixRu(Account):
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
- page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api']))
- page = json_loads(page)
+ page = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"}))
+
points = page['points']
- kb = float(points)
- kb = kb * 1024 ** 2 / 1000
+ kb = float(points) * 1024 ** 2 / 1000
+
if points > 0:
account_info = {"validuntil": -1, "trafficleft": kb}
else:
@@ -29,7 +29,8 @@ class FastixRu(Account):
def login(self, user, data, req):
- page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password']))
+ page = req.load("http://fastix.ru/api_v2/",
+ get={'sub': "get_apikey", 'email': user, 'password': data['password']})
api = json_loads(page)
api = api['apikey']
data['api'] = api