diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-08 23:31:33 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-08 23:31:33 +0100 |
commit | 36e60a23497ae05736c24fed2f4ce936fb61f744 (patch) | |
tree | d743ace8e6c032cccb524cbb8474263d9d7bd4e1 /module/plugins/accounts/Keep2shareCc.py | |
parent | "New Year" Update: internal plugins (diff) | |
download | pyload-36e60a23497ae05736c24fed2f4ce936fb61f744.tar.xz |
"New Year" Update: account plugins
Diffstat (limited to 'module/plugins/accounts/Keep2shareCc.py')
-rw-r--r-- | module/plugins/accounts/Keep2shareCc.py | 33 |
1 files changed, 19 insertions, 14 deletions
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() |