Repository navigation
Expand file tree
/
Copy pathRPNetBizHook.py
More file actions
38 lines (28 loc) · 1.37 KB
/
Copy pathRPNetBizHook.py
File metadata and controls
38 lines (28 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
from module.common.json_layer import json_loads
from module.plugins.internal.MultiHook import MultiHook
class RPNetBizHook(MultiHook):
__name__ = "RPNetBizHook"
__type__ = "hook"
__version__ = "0.16"
__status__ = "testing"
__config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"),
("pluginlist" , "str" , "Plugin list (comma separated)", "" ),
("reload" , "bool" , "Reload plugin list" , True ),
("reloadinterval", "int" , "Reload interval in hours" , 12 )]
__description__ = """RPNet.biz hook plugin"""
__license__ = "GPLv3"
__authors__ = [("Dman", "dmanugm@gmail.com")]
def get_hosters(self):
#: Get account data
user, info = self.account.select()
res = self.load("https://premium.rpnet.biz/client_api.php",
get={'username': user,
'password': info['login']['password'],
'action' : "showHosterList"})
hoster_list = json_loads(res)
#: If account is not valid thera are no hosters available
if 'error' in hoster_list:
return []
#: Extract hosters from json file
return hoster_list['hosters']