From 36e60a23497ae05736c24fed2f4ce936fb61f744 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Jan 2015 23:31:33 +0100 Subject: "New Year" Update: account plugins --- module/plugins/accounts/Keep2shareCc.py | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'module/plugins/accounts/Keep2shareCc.py') diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2shareCc.py index fac3cc4a6..e855fb977 100644 --- a/module/plugins/accounts/Keep2shareCc.py +++ b/module/plugins/accounts/Keep2shareCc.py @@ -7,12 +7,12 @@ from time import gmtime, mktime, strptime from module.plugins.Account import Account -class Keep2shareCc(Account): - __name__ = "Keep2shareCc" +class Keep2ShareCc(Account): + __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" - __description__ = """Keep2share.cc account plugin""" + __description__ = """Keep2Share.cc account plugin""" __license__ = "GPLv3" __authors__ = [("aeronaut", "aeronaut@pianoguy.de")] @@ -35,18 +35,22 @@ class Keep2shareCc(Account): expiredate = m.group(1).strip() self.logDebug("Expire date: " + expiredate) - try: - validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) + if expiredate == "LifeTime": + premium = True + validuntil = -1 + else: + try: + validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) - except Exception, e: - self.logError(e) + except Exception, e: + self.logError(e) - else: - if validuntil > mktime(gmtime()): - premium = True else: - premium = False - validuntil = None + if validuntil > mktime(gmtime()): + premium = True + else: + premium = False + validuntil = None m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: @@ -66,7 +70,8 @@ class Keep2shareCc(Account): post={'LoginForm[username]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, - 'yt0' : ""}) + 'yt0' : ""}, + decode=True) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() -- cgit v1.2.3