summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar gsasch <gsasch@gmail.com> 2014-12-30 02:15:15 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-30 02:15:15 +0100
commitf23eea11a1db7b742684c2cace195748dd684020 (patch)
tree02d1f81d6879feab8493bc042abdc92ac3706856 /module/plugins/accounts
parent[AlldebridCom] Code cosmetics (diff)
downloadpyload-f23eea11a1db7b742684c2cace195748dd684020.tar.xz
[UploadableCh] Account
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/UploadableCh.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/module/plugins/accounts/UploadableCh.py b/module/plugins/accounts/UploadableCh.py
new file mode 100644
index 000000000..14c19adda
--- /dev/null
+++ b/module/plugins/accounts/UploadableCh.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.Account import Account
+
+
+class UploadableCh(Account):
+ __name__ = "UploadableCh"
+ __type__ = "account"
+ __version__ = "0.02"
+
+ __description__ = """Uploadable.ch account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Sasch", "gsasch@gmail.com")]
+
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.uploadable.ch/login.php")
+
+ premium = '<a href="/logout.php"' in html
+ trafficleft = -1 if premium else None
+
+ return {'validuntil': None, 'trafficleft': trafficleft, 'premium': premium} #@TODO: validuntil
+
+
+ def login(self, user, data, req):
+ html = req.load("http://www.uploadable.ch/login.php",
+ post={'userName' : user,
+ 'userPassword' : data["password"],
+ 'autoLogin' : "1",
+ 'action__login': "normalLogin"})
+
+ if "Login failed" in html:
+ self.wrongPassword()