From ce1c2b6b05c08b669357947e61ae40efce7fc50f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 16 Feb 2015 10:46:28 +0100 Subject: module temp --- pyload/plugin/account/Keep2ShareCc.py | 69 ----------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 pyload/plugin/account/Keep2ShareCc.py (limited to 'pyload/plugin/account/Keep2ShareCc.py') diff --git a/pyload/plugin/account/Keep2ShareCc.py b/pyload/plugin/account/Keep2ShareCc.py deleted file mode 100644 index 7ed15dc62..000000000 --- a/pyload/plugin/account/Keep2ShareCc.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime - -from pyload.plugin.Account import Account - - -class Keep2shareCc(Account): - __name__ = "Keep2shareCc" - __type__ = "account" - __version__ = "0.02" - - __description__ = """Keep2share.cc account plugin""" - __license__ = "GPLv3" - __authors__ = [("aeronaut", "aeronaut@pianoguy.de")] - - - VALID_UNTIL_PATTERN = r'Premium expires: (.+?)' - TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):(.+?)' - - LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = None - premium = None - - html = req.load("http://keep2share.cc/site/profile.html", decode=True) - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - expiredate = m.group(1).strip() - self.logDebug("Expire date: " + expiredate) - - try: - validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) - - except Exception, e: - self.logError(e) - - else: - if validuntil > mktime(gmtime()): - premium = True - else: - premium = False - validuntil = None - - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: - try: - trafficleft = self.parseTraffic(m.group(1)) - - except Exception, e: - self.logError(e) - - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - - - def login(self, user, data, req): - req.cj.setCookie("keep2share.cc", "lang", "en") - - html = req.load("http://keep2share.cc/login.html", - post={'LoginForm[username]': user, 'LoginForm[password]': data['password']}) - - if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrongPassword() -- cgit v1.2.3