From 68d662e689cd42687341c550fb6ebb74e6968d21 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Sep 2014 00:29:57 +0200 Subject: module -> pyload --- pyload/plugins/accounts/CyberlockerCh.py | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pyload/plugins/accounts/CyberlockerCh.py (limited to 'pyload/plugins/accounts/CyberlockerCh.py') diff --git a/pyload/plugins/accounts/CyberlockerCh.py b/pyload/plugins/accounts/CyberlockerCh.py new file mode 100644 index 000000000..94cc0d8c4 --- /dev/null +++ b/pyload/plugins/accounts/CyberlockerCh.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +from pyload.plugins.internal.XFSPAccount import XFSPAccount +from pyload.plugins.internal.SimpleHoster import parseHtmlForm + + +class CyberlockerCh(XFSPAccount): + __name__ = "CyberlockerCh" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Cyberlocker.ch account plugin""" + __author_name__ = "stickell" + __author_mail__ = "l.stickell@yahoo.it" + + MAIN_PAGE = "http://cyberlocker.ch/" + + + def login(self, user, data, req): + html = req.load(self.MAIN_PAGE + 'login.html', decode=True) + + action, inputs = parseHtmlForm('name="FL"', html) + if not inputs: + inputs = {"op": "login", + "redirect": self.MAIN_PAGE} + + inputs.update({"login": user, + "password": data['password']}) + + # Without this a 403 Forbidden is returned + req.http.lastURL = self.MAIN_PAGE + 'login.html' + html = req.load(self.MAIN_PAGE, post=inputs, decode=True) + + if 'Incorrect Login or Password' in html or '>Error<' in html: + self.wrongPassword() -- cgit v1.2.3