From ce1c2b6b05c08b669357947e61ae40efce7fc50f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 16 Feb 2015 10:46:28 +0100 Subject: module temp --- module/plugins/accounts/MultishareCz.py | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 module/plugins/accounts/MultishareCz.py (limited to 'module/plugins/accounts/MultishareCz.py') diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py new file mode 100644 index 000000000..62b48c546 --- /dev/null +++ b/module/plugins/accounts/MultishareCz.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugin.Account import Account + + +class MultishareCz(Account): + __name__ = "MultishareCz" + __type__ = "account" + __version__ = "0.03" + + __description__ = """Multishare.cz account plugin""" + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + + + TRAFFIC_LEFT_PATTERN = r'Kredit:\s*(?P[\d.,]+) (?P[\w^_]+)' + ACCOUNT_INFO_PATTERN = r'' + + + def loadAccountInfo(self, user, req): + #self.relogin(user) + html = req.load("http://www.multishare.cz/profil/", decode=True) + + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + trafficleft = self.parseTraffic(m.group('S'), m.group('U')) if m else 0 + self.premium = True if trafficleft else False + + html = req.load("http://www.multishare.cz/", decode=True) + mms_info = dict(re.findall(self.ACCOUNT_INFO_PATTERN, html)) + + return dict(mms_info, **{"validuntil": -1, "trafficleft": trafficleft}) + + + def login(self, user, data, req): + html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', post={ + "akce": "Přihlásit", + "heslo": data['password'], + "jmeno": user + }, decode=True) + + if '
' in html: + self.wrongPassword() -- cgit v1.2.3