From acc46fc3497a66a427b795b4a22c6e71d69185a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 13 Dec 2014 15:56:57 +0100 Subject: Update --- pyload/plugin/account/FreakshareCom.py | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pyload/plugin/account/FreakshareCom.py (limited to 'pyload/plugin/account/FreakshareCom.py') diff --git a/pyload/plugin/account/FreakshareCom.py b/pyload/plugin/account/FreakshareCom.py new file mode 100644 index 000000000..76d094a8b --- /dev/null +++ b/pyload/plugin/account/FreakshareCom.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +import re + +from time import strptime, mktime + +from pyload.plugin.Account import Account + + +class FreakshareCom(Account): + __name = "FreakshareCom" + __type = "account" + __version = "0.11" + + __description = """Freakshare.com account plugin""" + __license = "GPLv3" + __authors = [("RaNaN", "RaNaN@pyload.org")] + + + def loadAccountInfo(self, user, req): + page = req.load("http://freakshare.com/") + + validuntil = r'ltig bis:\s*([\d.:-]+)' + validuntil = re.search(validuntil, page, re.M) + validuntil = validuntil.group(1).strip() + validuntil = mktime(strptime(validuntil, "%d.%m.%Y - %H:%M")) + + traffic = r'Traffic verbleibend:\s*([^<]+)' + traffic = re.search(traffic, page, re.M) + traffic = traffic.group(1).strip() + traffic = self.parseTraffic(traffic) + + return {"validuntil": validuntil, "trafficleft": traffic} + + + def login(self, user, data, req): + req.load("http://freakshare.com/index.php?language=EN") + + page = req.load("http://freakshare.com/login.html", None, + {"submit": "Login", "user": user, "pass": data['password']}, cookies=True) + + if ">Wrong Username or Password" in page: + self.wrongPassword() -- cgit v1.2.3