diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-06 22:24:17 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-06 22:24:17 +0200 |
commit | cac52bbf8b0e928a83a29b744bff20240c8e7354 (patch) | |
tree | b53689d1269f95dfda758879e7206d1c20cb5012 /module/plugins/accounts/NetloadIn.py | |
parent | closed #147 (diff) | |
download | pyload-cac52bbf8b0e928a83a29b744bff20240c8e7354.tar.xz |
Diffstat (limited to 'module/plugins/accounts/NetloadIn.py')
-rw-r--r-- | module/plugins/accounts/NetloadIn.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index 28b3a1c56..16e06b688 100644 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -18,6 +18,8 @@ """ from module.plugins.Account import Account +import re +from time import time class NetloadIn(Account): __name__ = "NetloadIn" @@ -26,8 +28,17 @@ class NetloadIn(Account): __description__ = """netload.in account plugin""" __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") + + def loadAccountInfo(self, user): + req = self.getAccountRequest(user) + page = req.load("http://netload.in/index.php?id=2") + left = r">(\d+) Tage, (\d+) Stunden<" + left = re.search(left, page) + validuntil = time() + int(left.group(1)) * 24 * 60 * 60 + int(left.group(2)) * 60 * 60 + return {"validuntil": validuntil, "trafficleft": -1} def login(self, user, data): req = self.getAccountRequest(user) - req.load("http://netload.in/index.php", None, { "txtuser" : user, "txtpass" : data['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) - + page = req.load("http://netload.in/index.php", None, { "txtuser" : user, "txtpass" : data['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) + if "password or it might be invalid!" in page: + self.wrongPassword() |