From 97d25752691aa561c29a91166fdd30302bef2db2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 00:54:03 +0200 Subject: [Account] parse_info -> grab_info --- 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 014d43a69..3c9a42808 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -25,7 +25,7 @@ class Keep2ShareCc(Account): LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - def parse_info(self, user, password, data, req): + def grab_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = False @@ -71,4 +71,4 @@ class Keep2ShareCc(Account): 'yt0' : ""}) if re.search(self.LOGIN_FAIL_PATTERN, html): - self.login_fail() + self.fail_login() -- cgit v1.2.3 From fb45ec44220201268f99b747831df717fa7a83f8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 16:31:48 +0200 Subject: [Account] Fix __version__ --- 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 3c9a42808..f67219af0 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -10,7 +10,7 @@ from module.plugins.internal.Plugin import set_cookie class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.08" + __version__ = "0.09" __status__ = "testing" __description__ = """Keep2Share.cc account plugin""" -- cgit v1.2.3 From ec6e5dc7fcdcefee10e37d22473c9accae1104cf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 29 Sep 2015 20:05:07 +0200 Subject: Account class completely rewritten + plugins updated --- 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 f67219af0..e76ec212c 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -10,7 +10,7 @@ from module.plugins.internal.Plugin import set_cookie class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.09" + __version__ = "0.10" __status__ = "testing" __description__ = """Keep2Share.cc account plugin""" @@ -25,7 +25,7 @@ class Keep2ShareCc(Account): LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - def grab_info(self, user, password, data, req): + def grab_info(self, user, password, data): validuntil = None trafficleft = -1 premium = False @@ -61,8 +61,8 @@ class Keep2ShareCc(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, password, data, req): - set_cookie(req.cj, "keep2share.cc", "lang", "en") + def signin(self, user, password, data): + set_cookie(self.req.cj, "keep2share.cc", "lang", "en") html = self.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, -- cgit v1.2.3 From 25d5726d4953b93a2e286fd6af8d4ead20670ba6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 1 Oct 2015 04:55:17 +0200 Subject: A lot of plugin code cosmetics --- 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 e76ec212c..32bccc2e4 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -33,7 +33,7 @@ class Keep2ShareCc(Account): html = self.load("http://keep2share.cc/site/profile.html") m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: + if m is not None: expiredate = m.group(1).strip() self.log_debug("Expire date: " + expiredate) @@ -51,7 +51,7 @@ class Keep2ShareCc(Account): premium = True if validuntil > time.mktime(time.gmtime()) else False m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: + if m is not None: try: trafficleft = self.parse_traffic(m.group(1)) -- cgit v1.2.3