summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/accounts/StahnuTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/accounts/StahnuTo.py')
-rw-r--r--pyload/plugins/accounts/StahnuTo.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/pyload/plugins/accounts/StahnuTo.py b/pyload/plugins/accounts/StahnuTo.py
new file mode 100644
index 000000000..9d4cc6994
--- /dev/null
+++ b/pyload/plugins/accounts/StahnuTo.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pyload.plugins.Account import Account
+from pyload.utils import parseFileSize
+
+
+class StahnuTo(Account):
+ __name__ = "StahnuTo"
+ __type__ = "account"
+ __version__ = "0.02"
+
+ __description__ = """StahnuTo account plugin"""
+ __author_name__ = "zoidberg"
+ __author_mail__ = "zoidberg@mujmail.cz"
+
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.stahnu.to/")
+
+ m = re.search(r'>VIP: (\d+.*)<', html)
+ trafficleft = parseFileSize(m.group(1)) * 1024 if m else 0
+
+ return {"premium": trafficleft > (512 * 1024), "trafficleft": trafficleft, "validuntil": -1}
+
+ def login(self, user, data, req):
+ html = req.load("http://www.stahnu.to/login.php", post={
+ "username": user,
+ "password": data['password'],
+ "submit": "Login"})
+
+ if not '<a href="logout.php">' in html:
+ self.wrongPassword()