summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/account/CyberlockerCh.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-03 19:58:02 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-03 19:58:02 +0200
commit43e6a6376625ac73067403ddae3b45a80618d6c8 (patch)
treeceb458c3da1f19e0a91731bc254ee3a158682d0b /pyload/plugins/account/CyberlockerCh.py
parent[ConfigParser] Remove IGNORE feature (diff)
downloadpyload-43e6a6376625ac73067403ddae3b45a80618d6c8.tar.xz
Rename accounts directory to account
Diffstat (limited to 'pyload/plugins/account/CyberlockerCh.py')
-rw-r--r--pyload/plugins/account/CyberlockerCh.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/pyload/plugins/account/CyberlockerCh.py b/pyload/plugins/account/CyberlockerCh.py
new file mode 100644
index 000000000..94cc0d8c4
--- /dev/null
+++ b/pyload/plugins/account/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()