diff options
author | GammaC0de <nitzo2001@yahoo.com> | 2016-05-01 12:42:20 +0200 |
---|---|---|
committer | GammaC0de <nitzo2001@yahoo.com> | 2016-05-01 12:42:20 +0200 |
commit | acdb461f9a767af167a8c9218220276586f91994 (patch) | |
tree | fad553e7b6b094f86e5d2a48441862d51d75cfe6 | |
parent | [MegaCoNz] update (diff) | |
download | pyload-acdb461f9a767af167a8c9218220276586f91994.tar.xz |
[EuroshareEu] Fix #2446
-rw-r--r-- | module/plugins/accounts/EuroshareEu.py | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index b1528c6dc..5e6debe8e 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -2,40 +2,56 @@ import re import time +import urlparse from module.plugins.internal.Account import Account +from module.plugins.internal.misc import parse_html_form class EuroshareEu(Account): __name__ = "EuroshareEu" __type__ = "account" - __version__ = "0.09" + __version__ = "0.10" __status__ = "testing" __description__ = """Euroshare.eu account plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __authors__ = [("zoidberg", "zoidberg@mujmail.cz" ), + ("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")] def grab_info(self, user, password, data): - html = self.load("http://euroshare.eu/customer-zone/settings/") + html = self.load("http://euroshare.eu/", + get={'lang': "en"}) - m = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html) + m = re.search(r'<span title="Premium do: (\d+\.\d+\.\d+ \d+:\d+:\d+)"', html) if m is None: premium = False validuntil = -1 else: premium = True - validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y %H:%M:%S")) return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} def signin(self, user, password, data): - html = self.load('http://euroshare.eu/customer-zone/login/', - post={'trvale' : "1", - 'login' : user, - 'password': password}) + login_url = "http://euroshare.eu/user/login/" + html = self.load(login_url, + get={'lang' : "en"}) - if u">Nesprávne prihlasovacie meno alebo heslo" in html: + if r'<li class="logout">' in html: + self.skip_login() + + action, inputs = parse_html_form('id="frm-prihlaseni"', html) + if not inputs: + self.fail_login(_("Login form not found")) + + inputs['username'] = user + inputs['password'] = password + + html = self.load(urlparse.urljoin(login_url, action), + post=inputs) + + if r'<li class="logout">' not in html: self.fail_login() |