diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-08 00:29:57 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 11:02:23 +0200 |
commit | 68d662e689cd42687341c550fb6ebb74e6968d21 (patch) | |
tree | 486cef41bd928b8db704894233b2cef94a6e346f /pyload/plugins/accounts/RealdebridCom.py | |
parent | save_join -> safe_join & save_path -> safe_filename (diff) | |
download | pyload-68d662e689cd42687341c550fb6ebb74e6968d21.tar.xz |
module -> pyload
Diffstat (limited to 'pyload/plugins/accounts/RealdebridCom.py')
-rw-r--r-- | pyload/plugins/accounts/RealdebridCom.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pyload/plugins/accounts/RealdebridCom.py b/pyload/plugins/accounts/RealdebridCom.py new file mode 100644 index 000000000..8ab0234a9 --- /dev/null +++ b/pyload/plugins/accounts/RealdebridCom.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +import xml.dom.minidom as dom + +from pyload.plugins.Account import Account + + +class RealdebridCom(Account): + __name__ = "RealdebridCom" + __type__ = "account" + __version__ = "0.43" + + __description__ = """Real-Debrid.com account plugin""" + __author_name__ = "Devirex Hazzard" + __author_mail__ = "naibaf_11@yahoo.de" + + + def loadAccountInfo(self, user, req): + if self.pin_code: + return {"premium": False} + page = req.load("https://real-debrid.com/api/account.php") + xml = dom.parseString(page) + account_info = {"validuntil": int(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), + "trafficleft": -1} + + return account_info + + def login(self, user, data, req): + self.pin_code = False + page = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data['password']}) + if "Your login informations are incorrect" in page: + self.wrongPassword() + elif "PIN Code required" in page: + 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.pin_code = True |