summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/account/CloudzillaTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/account/CloudzillaTo.py')
-rw-r--r--pyload/plugin/account/CloudzillaTo.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/pyload/plugin/account/CloudzillaTo.py b/pyload/plugin/account/CloudzillaTo.py
new file mode 100644
index 000000000..bee7c5a17
--- /dev/null
+++ b/pyload/plugin/account/CloudzillaTo.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pyload.plugin.Account import Account
+
+
+class CloudzillaTo(Account):
+ __name = "CloudzillaTo"
+ __type = "account"
+ __version = "0.02"
+
+ __description = """Cloudzilla.to account plugin"""
+ __license = "GPLv3"
+ __authors = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ PREMIUM_PATTERN = r'<h2>account type</h2>\s*Premium Account'
+
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.cloudzilla.to/")
+
+ premium = re.search(self.PREMIUM_PATTERN, html) is not None
+
+ 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"},
+ decode=True)
+
+ if "ERROR" in html:
+ self.wrongPassword()