diff options
author | Ivo Buff <kagenoshin@gmx.ch> | 2014-04-10 15:33:43 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-04-10 15:33:43 +0200 |
commit | b75cd8a3f83a970f67fcdfaa5bed7ecdb006b45b (patch) | |
tree | 7c7bc7324e59b5e0fcd93d1c46b61f51dfccdcd3 /module/plugins/accounts | |
parent | Upstore: using the improved ReCaptcha class (diff) | |
download | pyload-b75cd8a3f83a970f67fcdfaa5bed7ecdb006b45b.tar.xz |
New multihoster: Vipleech4u
Merges #524
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/Vipleech4uCom.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/module/plugins/accounts/Vipleech4uCom.py b/module/plugins/accounts/Vipleech4uCom.py new file mode 100644 index 000000000..1e8463456 --- /dev/null +++ b/module/plugins/accounts/Vipleech4uCom.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +import re +from time import mktime, strptime + +from module.plugins.Account import Account + + +class Vipleech4uCom(Account): + __name__ = "Vipleech4uCom" + __version__ = "0.1" + __type__ = "account" + __description__ = """Vipleech4u.com account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + STATUS_PATTERN = re.compile(r'status.*?<\s*?strong\s*?>[^<]*?vip[^<]*?<', re.I) + VALIDUNTIL_PATTERN = re.compile(r'valid\s*?until.*?<\s*?strong\s*?>([^<]*?)<', re.I) + + def loadAccountInfo(self, user, req): + response = req.load("http://vipleech4u.com", decode=True) + status = self.STATUS_PATTERN.search(response) + + validuntil = self.VALIDUNTIL_PATTERN.search(response) + if validuntil: + validuntil = validuntil.group(1) + + if status and validuntil: + print status + print validuntil + return {"trafficleft": -1, "validuntil": mktime(strptime("%s 23:59" % validuntil, "%d-%m-%Y %H:%M"))} + else: + return {"premium": False} + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + post_data = {'action': 'login', 'user': self.loginname, 'pass': self.password} + req.load("http://vipleech4u.com/login.php") + response = req.load("http://vipleech4u.com/login.php", post=post_data, decode=True) + if 'Username or Password are incorrect' in response: + self.wrongPassword() |