From c4f167e267ba949ee20ec8a6d3c611d6dd93b325 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 20 Jan 2015 01:22:00 +0100 Subject: Fix plugin filename case --- module/plugins/accounts/File4SafeCom.py | 18 ++++++++ module/plugins/accounts/File4safeCom.py | 18 -------- module/plugins/accounts/Keep2ShareCc.py | 74 +++++++++++++++++++++++++++++++++ module/plugins/accounts/Keep2shareCc.py | 74 --------------------------------- module/plugins/accounts/NetloadIn.py | 0 5 files changed, 92 insertions(+), 92 deletions(-) create mode 100644 module/plugins/accounts/File4SafeCom.py delete mode 100644 module/plugins/accounts/File4safeCom.py create mode 100644 module/plugins/accounts/Keep2ShareCc.py delete mode 100644 module/plugins/accounts/Keep2shareCc.py mode change 100755 => 100644 module/plugins/accounts/NetloadIn.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/File4SafeCom.py b/module/plugins/accounts/File4SafeCom.py new file mode 100644 index 000000000..50fe1aac8 --- /dev/null +++ b/module/plugins/accounts/File4SafeCom.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSAccount import XFSAccount + + +class File4SafeCom(XFSAccount): + __name__ = "File4SafeCom" + __type__ = "account" + __version__ = "0.05" + + __description__ = """File4Safe.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] + + + HOSTER_DOMAIN = "file4safe.com" + + LOGIN_FAIL_PATTERN = r'input_login' diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4safeCom.py deleted file mode 100644 index 50fe1aac8..000000000 --- a/module/plugins/accounts/File4safeCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class File4SafeCom(XFSAccount): - __name__ = "File4SafeCom" - __type__ = "account" - __version__ = "0.05" - - __description__ = """File4Safe.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] - - - HOSTER_DOMAIN = "file4safe.com" - - LOGIN_FAIL_PATTERN = r'input_login' diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py new file mode 100644 index 000000000..9f28799a2 --- /dev/null +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- + +import re + +from time import gmtime, mktime, strptime + +from module.plugins.Account import Account + + +class Keep2ShareCc(Account): + __name__ = "Keep2ShareCc" + __type__ = "account" + __version__ = "0.05" + + __description__ = """Keep2Share.cc account plugin""" + __license__ = "GPLv3" + __authors__ = [("aeronaut", "aeronaut@pianoguy.de"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + VALID_UNTIL_PATTERN = r'Premium expires:\s*(.+?)<' + TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):\s*(.+?)<' + + LOGIN_FAIL_PATTERN = r'Please fix the following input errors' + + + def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = -1 + premium = False + + 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) + + if expiredate == "LifeTime": + premium = True + validuntil = -1 + else: + try: + validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) + + except Exception, e: + self.logError(e) + + else: + premium = True if validuntil > mktime(gmtime()) else False + + 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'], + 'LoginForm[rememberMe]': 1, + 'yt0' : ""}, + decode=True) + + if re.search(self.LOGIN_FAIL_PATTERN, html): + self.wrongPassword() diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2shareCc.py deleted file mode 100644 index 9f28799a2..000000000 --- a/module/plugins/accounts/Keep2shareCc.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime - -from module.plugins.Account import Account - - -class Keep2ShareCc(Account): - __name__ = "Keep2ShareCc" - __type__ = "account" - __version__ = "0.05" - - __description__ = """Keep2Share.cc account plugin""" - __license__ = "GPLv3" - __authors__ = [("aeronaut", "aeronaut@pianoguy.de"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - VALID_UNTIL_PATTERN = r'Premium expires:\s*(.+?)<' - TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):\s*(.+?)<' - - LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = -1 - premium = False - - 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) - - if expiredate == "LifeTime": - premium = True - validuntil = -1 - else: - try: - validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) - - except Exception, e: - self.logError(e) - - else: - premium = True if validuntil > mktime(gmtime()) else False - - 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'], - 'LoginForm[rememberMe]': 1, - 'yt0' : ""}, - decode=True) - - if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrongPassword() diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py old mode 100755 new mode 100644 -- cgit v1.2.3