diff options
Diffstat (limited to 'module/plugins/accounts/RealdebridCom.py')
-rw-r--r-- | module/plugins/accounts/RealdebridCom.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 41d8a0975..718850c1a 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -2,39 +2,44 @@ import xml.dom.minidom as dom -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class RealdebridCom(Account): __name__ = "RealdebridCom" __type__ = "account" - __version__ = "0.45" + __version__ = "0.48" + __status__ = "testing" __description__ = """Real-Debrid.com account plugin""" __license__ = "GPLv3" __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] - def loadAccountInfo(self, user, req): + def parse_info(self, user, password, data, req): if self.pin_code: - return {"premium": False} - html = req.load("https://real-debrid.com/api/account.php") - xml = dom.parseString(html) - account_info = {"validuntil": float(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), - "trafficleft": -1} + return - return account_info + html = self.load("https://real-debrid.com/api/account.php") + xml = dom.parseString(html) + validuntil = float(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue) - def login(self, user, data, req): + return {'validuntil' : validuntil, + 'trafficleft': -1 , + 'premium' : True } + + + def login(self, user, password, data, req): self.pin_code = False - html = req.load("https://real-debrid.com/ajax/login.php", - get={"user": user, "pass": data['password']}, - decode=True) + + html = self.load("https://real-debrid.com/ajax/login.php", + get={'user': user, + 'pass': password}) if "Your login informations are incorrect" in html: - self.wrongPassword() + self.login_fail() elif "PIN Code required" in html: - self.logWarning(_("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com")) + self.log_warning(_("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com")) self.pin_code = True |