summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/NetloadIn.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-06 22:24:17 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-06 22:24:17 +0200
commitcac52bbf8b0e928a83a29b744bff20240c8e7354 (patch)
treeb53689d1269f95dfda758879e7206d1c20cb5012 /module/plugins/accounts/NetloadIn.py
parentclosed #147 (diff)
downloadpyload-cac52bbf8b0e928a83a29b744bff20240c8e7354.tar.xz
freakshare premium, closed #146, closed #147
Diffstat (limited to 'module/plugins/accounts/NetloadIn.py')
-rw-r--r--module/plugins/accounts/NetloadIn.py15
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()