diff options
author | 2015-08-09 00:50:54 +0200 | |
---|---|---|
committer | 2015-08-09 00:50:54 +0200 | |
commit | b0ef3f1673e1930916604bb1264ca3a38414bc8d (patch) | |
tree | c97936e4d2a4cd6eb1072c65c8a08a7d18816b18 /module/plugins/accounts/MegaDebridEu.py | |
parent | [XFileSharingPro][XFileSharingProFolder] Added default __pattern__ (diff) | |
parent | Fix https://github.com/pyload/pyload/issues/1707 (diff) | |
download | pyload-b0ef3f1673e1930916604bb1264ca3a38414bc8d.tar.xz |
Merge pull request #1 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/accounts/MegaDebridEu.py')
-rw-r--r-- | module/plugins/accounts/MegaDebridEu.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index a082b97af..d7a04491d 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -1,39 +1,44 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class MegaDebridEu(Account): __name__ = "MegaDebridEu" __type__ = "account" - __version__ = "0.20" + __version__ = "0.22" + __status__ = "testing" - __description__ = """mega-debrid.eu account plugin""" + __description__ = """Mega-debrid.eu account plugin""" __license__ = "GPLv3" __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] - # Define the base URL of MegaDebrid api + #: Define the base URL of MegaDebrid api API_URL = "https://www.mega-debrid.eu/api.php" - def loadAccountInfo(self, user, req): - data = self.getAccountData(user) - jsonResponse = req.load(self.API_URL, - get={'action': 'connectUser', 'login': user, 'password': data['password']}) + def parse_info(self, user, password, data, req): + data = self.get_data(user) + jsonResponse = self.load(self.API_URL, + get={'action' : 'connectUser', + 'login' : user, + 'password': password}) res = json_loads(jsonResponse) if res['response_code'] == "ok": - return {"premium": True, "validuntil": float(res['vip_end']), "status": True} + return {'premium': True, 'validuntil': float(res['vip_end']), 'status': True} else: - self.logError(res) - return {"status": False, "premium": False} + self.log_error(res) + return {'status': False, 'premium': False} - def login(self, user, data, req): - jsonResponse = req.load(self.API_URL, - get={'action': 'connectUser', 'login': user, 'password': data['password']}) + def login(self, user, password, data, req): + jsonResponse = self.load(self.API_URL, + get={'action' : 'connectUser', + 'login' : user, + 'password': password}) res = json_loads(jsonResponse) if res['response_code'] != "ok": - self.wrongPassword() + self.login_fail() |