From acc46fc3497a66a427b795b4a22c6e71d69185a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 13 Dec 2014 15:56:57 +0100 Subject: Update --- pyload/plugin/account/RapiduNet.py | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 pyload/plugin/account/RapiduNet.py (limited to 'pyload/plugin/account/RapiduNet.py') diff --git a/pyload/plugin/account/RapiduNet.py b/pyload/plugin/account/RapiduNet.py new file mode 100644 index 000000000..dfb18d2c7 --- /dev/null +++ b/pyload/plugin/account/RapiduNet.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugin.Account import Account +from pyload.utils import json_loads + + +class RapiduNet(Account): + __name = "RapiduNet" + __type = "account" + __version = "0.02" + + __description = """Rapidu.net account plugin""" + __license = "GPLv3" + __authors = [("prOq", "")] + + + PREMIUM_PATTERN = r'Account: Premium' + + + def loadAccountInfo(self, user, req): + info = {'validuntil': None, 'trafficleft': None, 'premium': False} + + req.load("https://rapidu.net/ajax.php", get={'a': "getChangeLang"}, post={"_go": "", "lang": "en"}) + html = req.load("https://rapidu.net/", decode=True) + + if re.search(self.PREMIUM_PATTERN, html): + info['premium'] = True + + return info + + + def login(self, user, data, req): + try: + json = json_loads(req.load("https://rapidu.net/ajax.php?a=getUserLogin", + post={'_go': "", + 'login': user, + 'pass': data['password'], + 'member': "1"})) + + self.logDebug(json) + + if not json['message'] == "success": + self.wrongPassword() + + except Exception, e: + self.logError(e) -- cgit v1.2.3