summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/MegaDebridEu.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/MegaDebridEu.py')
-rw-r--r--module/plugins/accounts/MegaDebridEu.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py
index d7a04491d..46375716f 100644
--- a/module/plugins/accounts/MegaDebridEu.py
+++ b/module/plugins/accounts/MegaDebridEu.py
@@ -7,9 +7,13 @@ from module.common.json_layer import json_loads
class MegaDebridEu(Account):
__name__ = "MegaDebridEu"
__type__ = "account"
- __version__ = "0.22"
+ __version__ = "0.24"
__status__ = "testing"
+ __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to use" , "all"),
+ ("mh_list" , "str" , "Hoster list (comma separated)", "" ),
+ ("mh_interval", "int" , "Reload interval in minutes" , 60 )]
+
__description__ = """Mega-debrid.eu account plugin"""
__license__ = "GPLv3"
__authors__ = [("D.Ducatel", "dducatel@je-geek.fr")]
@@ -19,8 +23,20 @@ class MegaDebridEu(Account):
API_URL = "https://www.mega-debrid.eu/api.php"
- def parse_info(self, user, password, data, req):
- data = self.get_data(user)
+ def grab_hosters(self, user, password, data):
+ reponse = self.load("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"})
+ json_data = json_loads(reponse)
+
+ if json_data['response_code'] == "ok":
+ host_list = [element[0] for element in json_data['hosters']]
+ else:
+ self.log_error(_("Unable to retrieve hoster list"))
+ host_list = []
+
+ return host_list
+
+
+ def grab_info(self, user, password, data):
jsonResponse = self.load(self.API_URL,
get={'action' : 'connectUser',
'login' : user,
@@ -34,11 +50,11 @@ class MegaDebridEu(Account):
return {'status': False, 'premium': False}
- def login(self, user, password, data, req):
+ def signin(self, user, password, data):
jsonResponse = self.load(self.API_URL,
get={'action' : 'connectUser',
'login' : user,
'password': password})
res = json_loads(jsonResponse)
if res['response_code'] != "ok":
- self.login_fail()
+ self.fail_login()