diff options
Diffstat (limited to 'module/plugins/accounts/MultishareCz.py')
-rw-r--r-- | module/plugins/accounts/MultishareCz.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index c9e30a93f..77facb308 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -8,9 +8,13 @@ from module.plugins.internal.Account import Account class MultishareCz(Account): __name__ = "MultishareCz" __type__ = "account" - __version__ = "0.07" + __version__ = "0.10" __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")] @@ -19,13 +23,20 @@ class MultishareCz(Account): TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[\d.,]+) (?P<U>[\w^_]+)</strong>' ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name=".+?" value="(.+?)">' + PLUGIN_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="(.+?)"></td>\s*<td class="stav">[^>]*?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 parse_info(self, user, password, data, req): + def grab_info(self, user, password, data): # self.relogin(user) 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 + 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/") @@ -34,11 +45,11 @@ class MultishareCz(Account): return dict(mms_info, **{'validuntil': -1, 'trafficleft': trafficleft}) - def login(self, user, password, data, req): + 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 '<div class="akce-chyba akce">' in html: - self.login_fail() + self.fail_login() |