diff options
author | prOq <anonim> | 2014-10-24 15:29:52 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-05 20:53:22 +0100 |
commit | ada1607d8a7190386e7a13dde2d8e312c2f6edf0 (patch) | |
tree | c426fa82a70a015f4d495d4f333fa815c5071d17 /module/plugins/accounts | |
parent | [DodanePl] Mark dead XD (diff) | |
download | pyload-ada1607d8a7190386e7a13dde2d8e312c2f6edf0.tar.xz |
[RapiduNet] new hoster and account plugin
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/RapiduNet.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py new file mode 100644 index 000000000..2fabb6120 --- /dev/null +++ b/module/plugins/accounts/RapiduNet.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Account import Account +from module.common.json_layer import json_loads + + +class RapiduNet(Account): + __name__ = "RapiduNet" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Rapidu.net account plugin""" + __license__ = "GPLv3" + __authors__ = [("prOq", None)] + + + ACCOUNT_INFO_PATTERN = '<a href="premium/" style="padding-left: 0px;">Account: <b>(.*?)</b></a>' + + + def loadAccountInfo(self, user, req): + premium = False + + req.load('https://rapidu.net/ajax.php?a=getChangeLang', post={"_go": "", "lang": "en"}) + self.html = req.load('https://rapidu.net/', decode=True) + + m = re.search(self.ACCOUNT_INFO_PATTERN, self.html) + if m: + if m.group(1) == "Premium": + premium = True + + return {"validuntil": None, "trafficleft": None, "premium": premium} + + + def login(self, user, data, req): + try: + json = req.load('https://rapidu.net/ajax.php?a=getUserLogin', post={"_go": "", "login": user, "pass": data['password'], "member": "1"}) + json = json_loads(json) + self.logDebug(json) + + if not json['message'] == "success": + self.wrongPassword() + except Exception, e: + self.logError(e) + |