diff options
Diffstat (limited to 'module/plugins/accounts/UploadheroCom.py')
-rw-r--r-- | module/plugins/accounts/UploadheroCom.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 714f5b0a6..f31b01d03 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -4,39 +4,40 @@ import re import datetime import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class UploadheroCom(Account): __name__ = "UploadheroCom" __type__ = "account" - __version__ = "0.21" + __version__ = "0.23" + __status__ = "testing" __description__ = """Uploadhero.co account plugin""" __license__ = "GPLv3" __authors__ = [("mcmyst", "mcmyst@hotmail.fr")] - def loadAccountInfo(self, user, req): + def parse_info(self, user, password, data, req): premium_pattern = re.compile('Il vous reste <span class="bleu">(\d+)</span> jours premium') - data = self.getAccountData(user) - html = req.load("http://uploadhero.co/my-account") + data = self.get_data(user) + html = self.load("http://uploadhero.co/my-account") if premium_pattern.search(html): end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(html).group(1))) end_date = time.mktime(future.timetuple()) - account_info = {"validuntil": end_date, "trafficleft": -1, "premium": True} + account_info = {'validuntil': end_date, 'trafficleft': -1, 'premium': True} else: - account_info = {"validuntil": -1, "trafficleft": -1, "premium": False} + account_info = {'validuntil': -1, 'trafficleft': -1, 'premium': False} return account_info - def login(self, user, data, req): - html = req.load("http://uploadhero.co/lib/connexion.php", - post={"pseudo_login": user, "password_login": data['password']}, - decode=True) + def login(self, user, password, data, req): + html = self.load("http://uploadhero.co/lib/connexion.php", + post={'pseudo_login': user, + 'password_login': password}) if "mot de passe invalide" in html: - self.wrongPassword() + self.login_fail() |