# -*- coding: utf-8 -*- import re from module.plugins.internal.MultiAccount import MultiAccount class MultishareCz(MultiAccount): __name__ = "MultishareCz" __type__ = "account" __version__ = "0.12" __status__ = "testing" __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to use" , "all"), ("mh_list" , "str" , "Hoster list (comma separated)", "" ), ("mh_interval", "int" , "Reload interval in minutes" , 60 )] __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'' PLUGIN_PATTERN = r']*?alt="(.+?)">\s*[^>]*?alt="OK"' def grab_hosters(self, user, password, data): html = self.load("http://www.multishare.cz/monitoring/") return re.findall(self.PLUGIN_PATTERN, html) def grab_info(self, user, password, data): html = self.load("http://www.multishare.cz/profil/") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = self.parse_traffic(m.group('S'), m.group('U')) if m else 0 self.premium = True if trafficleft else False html = self.load("http://www.multishare.cz/") mms_info = dict(re.findall(self.ACCOUNT_INFO_PATTERN, html)) return dict(mms_info, **{'validuntil': -1, 'trafficleft': trafficleft}) def signin(self, user, password, data): html = self.load('https://www.multishare.cz/html/prihlaseni_process.php', post={'akce' : "Přihlásit", 'heslo': password, 'jmeno': user}) if '
' in html: self.fail_login()