summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-21 23:25:35 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-21 23:25:35 +0200
commitb55419b584a69e1616e1d1d161c918666d739831 (patch)
tree4418fce4f66302fe841bda19496d7722afa26770 /module/plugins
parent[Account] Fix __version__ (diff)
downloadpyload-b55419b584a69e1616e1d1d161c918666d739831.tar.xz
[FastixRu] Fixup
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/FastixRu.py31
-rw-r--r--module/plugins/hoster/FastixRu.py14
2 files changed, 25 insertions, 20 deletions
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']
diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py
index 0019cf3c2..f00dded3f 100644
--- a/module/plugins/hoster/FastixRu.py
+++ b/module/plugins/hoster/FastixRu.py
@@ -10,7 +10,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class FastixRu(MultiHoster):
__name__ = "FastixRu"
__type__ = "hoster"
- __version__ = "0.13"
+ __version__ = "0.14"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}'
@@ -27,13 +27,11 @@ class FastixRu(MultiHoster):
def handle_premium(self, pyfile):
- api_key = self.account.get_data(self.user)
- api_key = api_key['api']
-
- self.html = self.load("http://fastix.ru/api_v2/",
- get={'apikey': api_key, 'sub': "getdirectlink", 'link': pyfile.url})
-
- data = json_loads(self.html)
+ self.html = json_loads(self.load("http://fastix.ru/api_v2/",
+ get={'apikey': self.account.get_data()['apikey'],
+ 'sub' : "getdirectlink",
+ 'link' : pyfile.url})
+ data = self.html)
self.log_debug("Json data", data)