From adc3ac5b3a92bef7b277ffab0ff57d20f38d4169 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 2 Jun 2015 19:42:16 +0200 Subject: [FilerNet] Account fixup --- module/plugins/accounts/FilerNet.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index ac5fd11da..149ff7d89 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -9,14 +9,14 @@ from module.plugins.Account import Account class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Filer.net account plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] - TOKEN_PATTERN = r'_csrf_token" value="(.+?)" />' + TOKEN_PATTERN = r'name="_csrf_token" value="(.+?)"' WALID_UNTIL_PATTERN = r'Der Premium-Zugang ist gültig bis (.+)\.\s*' TRAFFIC_PATTERN = r'Traffic\s*([^<]+)' FREE_PATTERN = r'Account Status\s*\s*Free' @@ -43,15 +43,15 @@ class FilerNet(Account): def login(self, user, data, req): - html = req.load("https://filer.net/login") + html = req.load("https://filer.net/login", decode=True) token = re.search(self.TOKEN_PATTERN, html).group(1) html = req.load("https://filer.net/login_check", - post={"_username": user, - "_password": data['password'], + post={"_username" : user, + "_password" : data['password'], "_remember_me": "on", - "_csrf_token": token, + "_csrf_token" : token, "_target_path": "https://filer.net/"}, decode=True) -- cgit v1.2.3 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/FilerNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 149ff7d89..f77ac5197 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -3,13 +3,13 @@ import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Filer.net 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/FilerNet.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index f77ac5197..aca09a7ed 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -23,7 +23,7 @@ class FilerNet(Account): def loadAccountInfo(self, user, req): - html = req.load("https://filer.net/profile") + html = self.load("https://filer.net/profile", req=req) # Free user if re.search(self.FREE_PATTERN, html): @@ -43,17 +43,16 @@ class FilerNet(Account): def login(self, user, data, req): - html = req.load("https://filer.net/login", decode=True) + html = self.load("https://filer.net/login", req=req) token = re.search(self.TOKEN_PATTERN, html).group(1) - html = req.load("https://filer.net/login_check", + html = self.load("https://filer.net/login_check", post={"_username" : user, "_password" : data['password'], "_remember_me": "on", "_csrf_token" : token, - "_target_path": "https://filer.net/"}, - decode=True) + "_target_path": "https://filer.net/"}, req=req) if 'Logout' not in html: self.wrongPassword() -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/accounts/FilerNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index aca09a7ed..9ab900831 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -25,7 +25,7 @@ class FilerNet(Account): def loadAccountInfo(self, user, req): html = self.load("https://filer.net/profile", req=req) - # Free user + #: Free user if re.search(self.FREE_PATTERN, html): return {"premium": False, "validuntil": None, "trafficleft": None} -- 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/FilerNet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 9ab900831..acee71912 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Filer.net account plugin""" __license__ = "GPLv3" @@ -22,7 +22,7 @@ class FilerNet(Account): FREE_PATTERN = r'Account Status\s*\s*Free' - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): html = self.load("https://filer.net/profile", req=req) #: Free user @@ -34,11 +34,11 @@ class FilerNet(Account): if until and traffic: validuntil = time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S")) - trafficleft = self.parseTraffic(traffic.group(1)) + trafficleft = self.parse_traffic(traffic.group(1)) return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} else: - self.logError(_("Unable to retrieve account information")) + self.log_error(_("Unable to retrieve account information")) return {"premium": False, "validuntil": None, "trafficleft": None} @@ -55,4 +55,4 @@ class FilerNet(Account): "_target_path": "https://filer.net/"}, req=req) if 'Logout' not 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/FilerNet.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index acee71912..192905ebe 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -48,11 +48,12 @@ class FilerNet(Account): token = re.search(self.TOKEN_PATTERN, html).group(1) html = self.load("https://filer.net/login_check", - post={"_username" : user, - "_password" : data['password'], - "_remember_me": "on", - "_csrf_token" : token, - "_target_path": "https://filer.net/"}, req=req) + post={"_username" : user, + "_password" : data['password'], + "_remember_me": "on", + "_csrf_token" : token, + "_target_path": "https://filer.net/"}, + req=req) if 'Logout' not 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/FilerNet.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 192905ebe..ac90c2993 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -23,7 +23,7 @@ class FilerNet(Account): def load_account_info(self, user, req): - html = self.load("https://filer.net/profile", req=req) + html = self.load("https://filer.net/profile") #: Free user if re.search(self.FREE_PATTERN, html): @@ -43,7 +43,7 @@ class FilerNet(Account): def login(self, user, data, req): - html = self.load("https://filer.net/login", req=req) + html = self.load("https://filer.net/login") token = re.search(self.TOKEN_PATTERN, html).group(1) @@ -52,8 +52,7 @@ class FilerNet(Account): "_password" : data['password'], "_remember_me": "on", "_csrf_token" : token, - "_target_path": "https://filer.net/"}, - req=req) + "_target_path": "https://filer.net/"}) if 'Logout' not 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/FilerNet.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index ac90c2993..807c938f4 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -27,7 +27,7 @@ class FilerNet(Account): #: Free user if re.search(self.FREE_PATTERN, html): - return {"premium": False, "validuntil": None, "trafficleft": None} + return {'premium': False, 'validuntil': None, 'trafficleft': None} until = re.search(self.WALID_UNTIL_PATTERN, html) traffic = re.search(self.TRAFFIC_PATTERN, html) @@ -35,11 +35,11 @@ class FilerNet(Account): if until and traffic: validuntil = time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S")) trafficleft = self.parse_traffic(traffic.group(1)) - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} + return {'premium': True, 'validuntil': validuntil, 'trafficleft': trafficleft} else: self.log_error(_("Unable to retrieve account information")) - return {"premium": False, "validuntil": None, "trafficleft": None} + return {'premium': False, 'validuntil': None, 'trafficleft': None} def login(self, user, data, req): @@ -48,11 +48,11 @@ class FilerNet(Account): token = re.search(self.TOKEN_PATTERN, html).group(1) html = self.load("https://filer.net/login_check", - post={"_username" : user, - "_password" : data['password'], - "_remember_me": "on", - "_csrf_token" : token, - "_target_path": "https://filer.net/"}) + post={'_username' : user, + '_password' : data['password'], + '_remember_me': "on", + '_csrf_token' : token, + '_target_path': "https://filer.net/"}) if 'Logout' not 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/FilerNet.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 807c938f4..ea68ff44a 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -10,6 +10,7 @@ class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" __version__ = "0.07" + __status__ = "stable" __description__ = """Filer.net 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/FilerNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index ea68ff44a..186568841 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -10,7 +10,7 @@ class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" __version__ = "0.07" - __status__ = "stable" + __status__ = "testing" __description__ = """Filer.net 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/FilerNet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 186568841..c4d06690b 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -23,7 +23,7 @@ class FilerNet(Account): FREE_PATTERN = r'Account Status\s*\s*Free' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("https://filer.net/profile") #: Free user @@ -43,17 +43,17 @@ class FilerNet(Account): return {'premium': False, 'validuntil': None, 'trafficleft': None} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://filer.net/login") token = re.search(self.TOKEN_PATTERN, html).group(1) html = self.load("https://filer.net/login_check", post={'_username' : user, - '_password' : data['password'], + '_password' : password, '_remember_me': "on", '_csrf_token' : token, '_target_path': "https://filer.net/"}) if 'Logout' not 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/FilerNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FilerNet.py') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index c4d06690b..674c7a5dd 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -56,4 +56,4 @@ class FilerNet(Account): '_target_path': "https://filer.net/"}) if 'Logout' not in html: - self.fail() + self.login_fail() -- cgit v1.2.3