From 049298dbdbff33918454b03a3b072f418d47af97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Jun 2015 05:33:38 +0200 Subject: Use SSL when login account --- module/plugins/accounts/Keep2ShareCc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index d2ba1d237..1d70586a5 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -62,7 +62,7 @@ class Keep2ShareCc(Account): def login(self, user, data, req): req.cj.setCookie("keep2share.cc", "lang", "en") - html = req.load("http://keep2share.cc/login.html", + html = req.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, -- 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/Keep2ShareCc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 1d70586a5..8cd23aed6 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -3,13 +3,13 @@ import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Keep2Share.cc 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/Keep2ShareCc.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 8cd23aed6..617e18f25 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -28,7 +28,7 @@ class Keep2ShareCc(Account): trafficleft = -1 premium = False - html = req.load("http://keep2share.cc/site/profile.html", decode=True) + html = self.load("http://keep2share.cc/site/profile.html", req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -62,12 +62,11 @@ class Keep2ShareCc(Account): def login(self, user, data, req): req.cj.setCookie("keep2share.cc", "lang", "en") - html = req.load("https://keep2share.cc/login.html", + html = self.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, - 'yt0' : ""}, - decode=True) + 'yt0' : ""}, req=req) if re.search(self.LOGIN_FAIL_PATTERN, 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/Keep2ShareCc.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 617e18f25..71c099bea 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Keep2Share.cc account plugin""" __license__ = "GPLv3" @@ -23,7 +23,7 @@ class Keep2ShareCc(Account): LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): validuntil = None trafficleft = -1 premium = False @@ -33,7 +33,7 @@ class Keep2ShareCc(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: expiredate = m.group(1).strip() - self.logDebug("Expire date: " + expiredate) + self.log_debug("Expire date: " + expiredate) if expiredate == "LifeTime": premium = True @@ -43,7 +43,7 @@ class Keep2ShareCc(Account): validuntil = time.mktime(time.strptime(expiredate, "%Y.%m.%d")) except Exception, e: - self.logError(e) + self.log_error(e) else: premium = True if validuntil > time.mktime(time.gmtime()) else False @@ -51,10 +51,10 @@ class Keep2ShareCc(Account): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: try: - trafficleft = self.parseTraffic(m.group(1)) + trafficleft = self.parse_traffic(m.group(1)) except Exception, e: - self.logError(e) + self.log_error(e) return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} @@ -69,4 +69,4 @@ class Keep2ShareCc(Account): 'yt0' : ""}, req=req) if re.search(self.LOGIN_FAIL_PATTERN, 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/Keep2ShareCc.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 71c099bea..5c6b3cce8 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -63,10 +63,11 @@ class Keep2ShareCc(Account): req.cj.setCookie("keep2share.cc", "lang", "en") html = self.load("https://keep2share.cc/login.html", - post={'LoginForm[username]' : user, - 'LoginForm[password]' : data['password'], - 'LoginForm[rememberMe]': 1, - 'yt0' : ""}, req=req) + post={'LoginForm[username]' : user, + 'LoginForm[password]' : data['password'], + 'LoginForm[rememberMe]': 1, + 'yt0' : ""}, + req=req) if re.search(self.LOGIN_FAIL_PATTERN, 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/Keep2ShareCc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 5c6b3cce8..6b2a8d68a 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -28,7 +28,7 @@ class Keep2ShareCc(Account): trafficleft = -1 premium = False - html = self.load("http://keep2share.cc/site/profile.html", req=req) + html = self.load("http://keep2share.cc/site/profile.html") m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -66,8 +66,7 @@ class Keep2ShareCc(Account): post={'LoginForm[username]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, - 'yt0' : ""}, - req=req) + 'yt0' : ""}) if re.search(self.LOGIN_FAIL_PATTERN, 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/Keep2ShareCc.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 6b2a8d68a..d80f897d1 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -10,6 +10,7 @@ class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" __version__ = "0.07" + __status__ = "stable" __description__ = """Keep2Share.cc 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/Keep2ShareCc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index d80f897d1..097ae7c7e 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -10,7 +10,7 @@ class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" __version__ = "0.07" - __status__ = "stable" + __status__ = "testing" __description__ = """Keep2Share.cc 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/Keep2ShareCc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 097ae7c7e..3a6100bb3 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -24,7 +24,7 @@ class Keep2ShareCc(Account): LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = False @@ -60,14 +60,14 @@ class Keep2ShareCc(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("keep2share.cc", "lang", "en") html = self.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, - 'LoginForm[password]' : data['password'], + 'LoginForm[password]' : password, 'LoginForm[rememberMe]': 1, 'yt0' : ""}) if re.search(self.LOGIN_FAIL_PATTERN, 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/Keep2ShareCc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 3a6100bb3..a7f8564d9 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -70,4 +70,4 @@ class Keep2ShareCc(Account): 'yt0' : ""}) if re.search(self.LOGIN_FAIL_PATTERN, html): - self.fail() + self.login_fail() -- cgit v1.2.3 From e5ce0acf056dc96c40d5616ab6d2b82f998eefbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Aug 2015 00:37:57 +0200 Subject: Use set_cookie instead cj.setCookie --- module/plugins/accounts/Keep2ShareCc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/Keep2ShareCc.py') diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index a7f8564d9..014d43a69 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -4,12 +4,13 @@ import re import time from module.plugins.internal.Account import Account +from module.plugins.internal.Plugin import set_cookie class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.07" + __version__ = "0.08" __status__ = "testing" __description__ = """Keep2Share.cc account plugin""" @@ -61,7 +62,7 @@ class Keep2ShareCc(Account): def login(self, user, password, data, req): - req.cj.setCookie("keep2share.cc", "lang", "en") + set_cookie(req.cj, "keep2share.cc", "lang", "en") html = self.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, -- cgit v1.2.3