forked from pyload/pyload
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPNetBiz.py
More file actions
38 lines (28 loc) · 1.61 KB
/
RPNetBiz.py
File metadata and controls
38 lines (28 loc) · 1.61 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 RPNetBiz(MultiHook):
__name__ = "RPNetBiz"
__type__ = "hook"
__version__ = "0.14"
__config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"),
("pluginlist" , "str" , "Plugin list (comma separated)" , "" ),
("revertfailed" , "bool" , "Revert to standard download if fails", True ),
("retry" , "int" , "Number of retries before revert" , 10 ),
("retryinterval" , "int" , "Retry interval in minutes" , 1 ),
("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 getHosters(self):
# Get account data
user, data = self.account.selectAccount()
res = self.getURL("https://premium.rpnet.biz/client_api.php",
get={'username': user, 'password': data['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']