From 43e6a6376625ac73067403ddae3b45a80618d6c8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 19:58:02 +0200 Subject: Rename accounts directory to account --- pyload/plugins/account/StahnuTo.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pyload/plugins/account/StahnuTo.py (limited to 'pyload/plugins/account/StahnuTo.py') diff --git a/pyload/plugins/account/StahnuTo.py b/pyload/plugins/account/StahnuTo.py new file mode 100644 index 000000000..ba4a3fcdd --- /dev/null +++ b/pyload/plugins/account/StahnuTo.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugins.base.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 '' in html: + self.wrongPassword() -- cgit v1.2.3