From 04302ed62dda2bec2d0e6f3ead95029fab9c8568 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 22 Dec 2014 22:30:46 +0100 Subject: New plugin: CloudzillaTo --- module/plugins/accounts/CloudzillaTo.py | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 module/plugins/accounts/CloudzillaTo.py (limited to 'module/plugins/accounts/CloudzillaTo.py') diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py new file mode 100644 index 000000000..f0676f42f --- /dev/null +++ b/module/plugins/accounts/CloudzillaTo.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.Account import Account + + +class CloudzillaTo(Account): + __name__ = "CloudzillaTo" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Cloudzilla.to account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + PREMIUM_PATTERN = r'

account type

\s*Premium Account' + + + def loadAccountInfo(self, user, req): + html = req.load("http://www.cloudzilla.to/") + + premium = True if re.search(self.PREMIUM_PATTERN, html) else False + + return {'validuntil': -1, 'trafficleft': -1, 'premium': premium} + + + def login(self, user, data, req): + html = req.load("http://www.cloudzilla.to/", + post={'lusername': user, + 'lpassword': data['password'], + 'w' : "dologin"}) + + if "ERROR" in html: + self.wrongPassword() -- cgit v1.2.3 From 36e60a23497ae05736c24fed2f4ce936fb61f744 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Jan 2015 23:31:33 +0100 Subject: "New Year" Update: account plugins --- module/plugins/accounts/CloudzillaTo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/CloudzillaTo.py') diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py index f0676f42f..d22d5e4b3 100644 --- a/module/plugins/accounts/CloudzillaTo.py +++ b/module/plugins/accounts/CloudzillaTo.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class CloudzillaTo(Account): __name__ = "CloudzillaTo" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Cloudzilla.to account plugin""" __license__ = "GPLv3" @@ -30,7 +30,8 @@ class CloudzillaTo(Account): html = req.load("http://www.cloudzilla.to/", post={'lusername': user, 'lpassword': data['password'], - 'w' : "dologin"}) + 'w' : "dologin"}, + decode=True) if "ERROR" in html: self.wrongPassword() -- cgit v1.2.3