From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/accounts/UploadheroCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 714f5b0a6..f8f2fbc1d 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -4,13 +4,13 @@ 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.22" __description__ = """Uploadhero.co account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/accounts/UploadheroCom.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index f8f2fbc1d..598b7ac57 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -21,7 +21,7 @@ class UploadheroCom(Account): premium_pattern = re.compile('Il vous reste (\d+) jours premium') data = self.getAccountData(user) - html = req.load("http://uploadhero.co/my-account") + html = self.load("http://uploadhero.co/my-account", req=req) if premium_pattern.search(html): end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(html).group(1))) @@ -34,9 +34,8 @@ class UploadheroCom(Account): 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) + html = self.load("http://uploadhero.co/lib/connexion.php", + post={"pseudo_login": user, "password_login": data['password']}, req=req) if "mot de passe invalide" in html: self.wrongPassword() -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/accounts/UploadheroCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 598b7ac57..b72102300 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -10,17 +10,17 @@ from module.plugins.internal.Account import Account class UploadheroCom(Account): __name__ = "UploadheroCom" __type__ = "account" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Uploadhero.co account plugin""" __license__ = "GPLv3" __authors__ = [("mcmyst", "mcmyst@hotmail.fr")] - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): premium_pattern = re.compile('Il vous reste (\d+) jours premium') - data = self.getAccountData(user) + data = self.get_account_data(user) html = self.load("http://uploadhero.co/my-account", req=req) if premium_pattern.search(html): @@ -38,4 +38,4 @@ class UploadheroCom(Account): post={"pseudo_login": user, "password_login": data['password']}, req=req) if "mot de passe invalide" in html: - self.wrongPassword() + self.wrong_password() -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/accounts/UploadheroCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index b72102300..ffae50ce1 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -35,7 +35,9 @@ class UploadheroCom(Account): def login(self, user, data, req): html = self.load("http://uploadhero.co/lib/connexion.php", - post={"pseudo_login": user, "password_login": data['password']}, req=req) + post={"pseudo_login": user, + "password_login": data['password']}, + req=req) if "mot de passe invalide" in html: self.wrong_password() -- cgit v1.2.3 From 1f5a55ae2133a782bdcca334ecbcdbde50dbcf99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 15:29:48 +0200 Subject: No more need to use the req argument when call load method --- module/plugins/accounts/UploadheroCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index ffae50ce1..bb5eaa6c1 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -21,7 +21,7 @@ class UploadheroCom(Account): premium_pattern = re.compile('Il vous reste (\d+) jours premium') data = self.get_account_data(user) - html = self.load("http://uploadhero.co/my-account", req=req) + 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))) @@ -36,8 +36,7 @@ class UploadheroCom(Account): def login(self, user, data, req): html = self.load("http://uploadhero.co/lib/connexion.php", post={"pseudo_login": user, - "password_login": data['password']}, - req=req) + "password_login": data['password']}) if "mot de passe invalide" in html: self.wrong_password() -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/accounts/UploadheroCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index bb5eaa6c1..df323d71c 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -26,17 +26,17 @@ class UploadheroCom(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 = self.load("http://uploadhero.co/lib/connexion.php", - post={"pseudo_login": user, - "password_login": data['password']}) + post={'pseudo_login': user, + 'password_login': data['password']}) if "mot de passe invalide" in html: self.wrong_password() -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/accounts/UploadheroCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index df323d71c..2559bc183 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -11,6 +11,7 @@ class UploadheroCom(Account): __name__ = "UploadheroCom" __type__ = "account" __version__ = "0.23" + __status__ = "stable" __description__ = """Uploadhero.co account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/accounts/UploadheroCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 2559bc183..e9bad9273 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -11,7 +11,7 @@ class UploadheroCom(Account): __name__ = "UploadheroCom" __type__ = "account" __version__ = "0.23" - __status__ = "stable" + __status__ = "testing" __description__ = """Uploadhero.co account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/accounts/UploadheroCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index e9bad9273..0b82f0e5a 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -18,10 +18,10 @@ class UploadheroCom(Account): __authors__ = [("mcmyst", "mcmyst@hotmail.fr")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium_pattern = re.compile('Il vous reste (\d+) jours premium') - data = self.get_account_data(user) + data = self.get_data(user) html = self.load("http://uploadhero.co/my-account") if premium_pattern.search(html): @@ -34,10 +34,10 @@ class UploadheroCom(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://uploadhero.co/lib/connexion.php", post={'pseudo_login': user, - 'password_login': data['password']}) + 'password_login': password}) if "mot de passe invalide" in html: - self.wrong_password() + self.fail() -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/accounts/UploadheroCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 0b82f0e5a..f31b01d03 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -40,4 +40,4 @@ class UploadheroCom(Account): 'password_login': password}) if "mot de passe invalide" in html: - self.fail() + self.login_fail() -- cgit v1.2.3