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/OneFichierCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index b19e2bc69..a9c6829b1 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -4,13 +4,13 @@ import pycurl import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """1fichier.com 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/OneFichierCom.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index a9c6829b1..3a345bd9f 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -26,7 +26,7 @@ class OneFichierCom(Account): trafficleft = -1 premium = None - html = req.load("https://1fichier.com/console/abo.pl") + html = self.load("https://1fichier.com/console/abo.pl", req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -46,13 +46,12 @@ class OneFichierCom(Account): def login(self, user, data, req): req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") - html = req.load("https://1fichier.com/login.pl?lg=en", + html = self.load("https://1fichier.com/login.pl?lg=en", post={'mail' : user, 'pass' : data['password'], 'It' : "on", 'purge' : "off", - 'valider': "Send"}, - decode=True) + 'valider': "Send"}, req=req) if '>Invalid email address' in html or '>Invalid password' 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/OneFichierCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 3a345bd9f..12be92c3e 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.Account import Account class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" - __version__ = "0.13" + __version__ = "0.14" __description__ = """1fichier.com account plugin""" __license__ = "GPLv3" @@ -21,7 +21,7 @@ class OneFichierCom(Account): VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): validuntil = None trafficleft = -1 premium = None @@ -31,12 +31,12 @@ class OneFichierCom(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: expiredate = m.group(1) - self.logDebug("Expire date: " + expiredate) + self.log_debug("Expire date: " + expiredate) try: validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y")) except Exception, e: - self.logError(e) + self.log_error(e) else: premium = True @@ -54,4 +54,4 @@ class OneFichierCom(Account): 'valider': "Send"}, req=req) if '>Invalid email address' in html or '>Invalid password' 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/OneFichierCom.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 12be92c3e..62ff3e099 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -47,11 +47,12 @@ class OneFichierCom(Account): req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") html = self.load("https://1fichier.com/login.pl?lg=en", - post={'mail' : user, - 'pass' : data['password'], - 'It' : "on", - 'purge' : "off", - 'valider': "Send"}, req=req) + post={'mail' : user, + 'pass' : data['password'], + 'It' : "on", + 'purge' : "off", + 'valider': "Send"}, + req=req) if '>Invalid email address' in html or '>Invalid password' 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/OneFichierCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 62ff3e099..ef9274353 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -26,7 +26,7 @@ class OneFichierCom(Account): trafficleft = -1 premium = None - html = self.load("https://1fichier.com/console/abo.pl", req=req) + html = self.load("https://1fichier.com/console/abo.pl") m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -51,8 +51,7 @@ class OneFichierCom(Account): 'pass' : data['password'], 'It' : "on", 'purge' : "off", - 'valider': "Send"}, - req=req) + 'valider': "Send"}) if '>Invalid email address' in html or '>Invalid password' 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/OneFichierCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index ef9274353..9f16482c5 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -11,6 +11,7 @@ class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" __version__ = "0.14" + __status__ = "stable" __description__ = """1fichier.com 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/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 9f16482c5..fa44f050c 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -11,7 +11,7 @@ class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" __version__ = "0.14" - __status__ = "stable" + __status__ = "testing" __description__ = """1fichier.com 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/OneFichierCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index fa44f050c..2553462ca 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -22,7 +22,7 @@ class OneFichierCom(Account): VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = None @@ -44,15 +44,15 @@ class OneFichierCom(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False} - def login(self, user, data, req): + def login(self, user, password, data, req): req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") html = self.load("https://1fichier.com/login.pl?lg=en", post={'mail' : user, - 'pass' : data['password'], + 'pass' : password, 'It' : "on", 'purge' : "off", 'valider': "Send"}) if '>Invalid email address' in html or '>Invalid password' 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/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/OneFichierCom.py') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 2553462ca..3a0131a3f 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -55,4 +55,4 @@ class OneFichierCom(Account): 'valider': "Send"}) if '>Invalid email address' in html or '>Invalid password' in html: - self.fail() + self.login_fail() -- cgit v1.2.3