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/hoster/Keep2ShareCc.py | 115 +++++++++++++++++++++++++++++++++ module/plugins/hoster/Keep2shareCc.py | 115 --------------------------------- module/plugins/hoster/Share4WebCom.py | 22 +++++++ module/plugins/hoster/Share4webCom.py | 22 ------- module/plugins/hoster/Vipleech4UCom.py | 18 ++++++ module/plugins/hoster/Vipleech4uCom.py | 18 ------ 6 files changed, 155 insertions(+), 155 deletions(-) create mode 100644 module/plugins/hoster/Keep2ShareCc.py delete mode 100644 module/plugins/hoster/Keep2shareCc.py create mode 100644 module/plugins/hoster/Share4WebCom.py delete mode 100644 module/plugins/hoster/Share4webCom.py create mode 100644 module/plugins/hoster/Vipleech4UCom.py delete mode 100644 module/plugins/hoster/Vipleech4uCom.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py new file mode 100644 index 000000000..d02b9f709 --- /dev/null +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- + +import re + +from urlparse import urljoin + +from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class Keep2ShareCc(SimpleHoster): + __name__ = "Keep2ShareCc" + __type__ = "hoster" + __version__ = "0.20" + + __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' + + __description__ = """Keep2Share.cc hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + URL_REPLACEMENTS = [(__pattern__ + ".*", "http://k2s.cc/file/\g")] + + NAME_PATTERN = r'File: (?P.+)' + SIZE_PATTERN = r'Size: (?P[^<]+)' + + OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' + TEMP_OFFLINE_PATTERN = r'Downloading blocked due to' + + LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'"([^"]+url.html?file=.+?)"|window\.location\.href = \'(.+?)\';' + + CAPTCHA_PATTERN = r'src="(/file/captcha\.html.+?)"' + + WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' + TEMP_ERROR_PATTERN = r'>\s*(Download count files exceed|Traffic limit exceed|Free account does not allow to download more than one file at the same time)' + ERROR_PATTERN = r'>\s*(Free user can\'t download large files|You no can access to this file|This download available only for premium users|This is private file)' + + + def checkErrors(self): + m = re.search(self.TEMP_ERROR_PATTERN, self.html) + if m: + self.info['error'] = m.group(1) + self.wantReconnect = True + self.retry(wait_time=30 * 60, reason=m.group(0)) + + m = re.search(self.ERROR_PATTERN, self.html) + if m: + errmsg = self.info['error'] = m.group(1) + self.error(errmsg) + + m = re.search(self.WAIT_PATTERN, self.html) + if m: + self.logDebug("Hoster told us to wait for %s" % m.group(1)) + + # string to time convert courtesy of https://stackoverflow.com/questions/10663720 + ftr = [3600, 60, 1] + wait_time = sum([a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))]) + + self.wantReconnect = True + self.retry(wait_time=wait_time, reason="Please wait to download this file") + + self.info.pop('error', None) + + + def handleFree(self, pyfile): + self.fid = re.search(r'', self.html).group(1) + self.html = self.load(pyfile.url, post={'yt0': '', 'slow_id': self.fid}) + + self.checkErrors() + + m = re.search(self.LINK_FREE_PATTERN, self.html) + + if m is None: + self.handleCaptcha() + + self.wait(30) + + self.html = self.load(pyfile.url, post={'uniqueId': self.fid, 'free': 1}) + + self.checkErrors() + + m = re.search(self.LINK_FREE_PATTERN, self.html) + if m is None: + self.error(_("Free download link not found")) + + self.link = m.group(1) + + + def handleCaptcha(self): + recaptcha = ReCaptcha(self) + post_data = {'free' : 1, + 'freeDownloadRequest': 1, + 'uniqueId' : self.fid, + 'yt0' : ''} + + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: + captcha_url = urljoin("http://k2s.cc/", m.group(1)) + post_data['CaptchaForm[code]'] = self.decryptCaptcha(captcha_url) + else: + challenge, response = recaptcha.challenge() + post_data.update({'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response}) + + self.html = self.load(self.pyfile.url, post=post_data) + + if 'recaptcha' not in self.html: + self.correctCaptcha() + else: + self.invalidCaptcha() + + +getInfo = create_getInfo(Keep2ShareCc) diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py deleted file mode 100644 index d02b9f709..000000000 --- a/module/plugins/hoster/Keep2shareCc.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from urlparse import urljoin - -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - - -class Keep2ShareCc(SimpleHoster): - __name__ = "Keep2ShareCc" - __type__ = "hoster" - __version__ = "0.20" - - __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' - - __description__ = """Keep2Share.cc hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - URL_REPLACEMENTS = [(__pattern__ + ".*", "http://k2s.cc/file/\g")] - - NAME_PATTERN = r'File: (?P.+)' - SIZE_PATTERN = r'Size: (?P[^<]+)' - - OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' - TEMP_OFFLINE_PATTERN = r'Downloading blocked due to' - - LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'"([^"]+url.html?file=.+?)"|window\.location\.href = \'(.+?)\';' - - CAPTCHA_PATTERN = r'src="(/file/captcha\.html.+?)"' - - WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' - TEMP_ERROR_PATTERN = r'>\s*(Download count files exceed|Traffic limit exceed|Free account does not allow to download more than one file at the same time)' - ERROR_PATTERN = r'>\s*(Free user can\'t download large files|You no can access to this file|This download available only for premium users|This is private file)' - - - def checkErrors(self): - m = re.search(self.TEMP_ERROR_PATTERN, self.html) - if m: - self.info['error'] = m.group(1) - self.wantReconnect = True - self.retry(wait_time=30 * 60, reason=m.group(0)) - - m = re.search(self.ERROR_PATTERN, self.html) - if m: - errmsg = self.info['error'] = m.group(1) - self.error(errmsg) - - m = re.search(self.WAIT_PATTERN, self.html) - if m: - self.logDebug("Hoster told us to wait for %s" % m.group(1)) - - # string to time convert courtesy of https://stackoverflow.com/questions/10663720 - ftr = [3600, 60, 1] - wait_time = sum([a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))]) - - self.wantReconnect = True - self.retry(wait_time=wait_time, reason="Please wait to download this file") - - self.info.pop('error', None) - - - def handleFree(self, pyfile): - self.fid = re.search(r'', self.html).group(1) - self.html = self.load(pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - - self.checkErrors() - - m = re.search(self.LINK_FREE_PATTERN, self.html) - - if m is None: - self.handleCaptcha() - - self.wait(30) - - self.html = self.load(pyfile.url, post={'uniqueId': self.fid, 'free': 1}) - - self.checkErrors() - - m = re.search(self.LINK_FREE_PATTERN, self.html) - if m is None: - self.error(_("Free download link not found")) - - self.link = m.group(1) - - - def handleCaptcha(self): - recaptcha = ReCaptcha(self) - post_data = {'free' : 1, - 'freeDownloadRequest': 1, - 'uniqueId' : self.fid, - 'yt0' : ''} - - m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: - captcha_url = urljoin("http://k2s.cc/", m.group(1)) - post_data['CaptchaForm[code]'] = self.decryptCaptcha(captcha_url) - else: - challenge, response = recaptcha.challenge() - post_data.update({'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response}) - - self.html = self.load(self.pyfile.url, post=post_data) - - if 'recaptcha' not in self.html: - self.correctCaptcha() - else: - self.invalidCaptcha() - - -getInfo = create_getInfo(Keep2ShareCc) diff --git a/module/plugins/hoster/Share4WebCom.py b/module/plugins/hoster/Share4WebCom.py new file mode 100644 index 000000000..7a276c1fe --- /dev/null +++ b/module/plugins/hoster/Share4WebCom.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +from module.plugins.hoster.UnibytesCom import UnibytesCom +from module.plugins.internal.SimpleHoster import create_getInfo + + +class Share4WebCom(UnibytesCom): + __name__ = "Share4WebCom" + __type__ = "hoster" + __version__ = "0.11" + + __pattern__ = r'https?://(?:www\.)?share4web\.com/get/\w+' + + __description__ = """Share4web.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + + + HOSTER_DOMAIN = "share4web.com" + + +getInfo = create_getInfo(Share4WebCom) diff --git a/module/plugins/hoster/Share4webCom.py b/module/plugins/hoster/Share4webCom.py deleted file mode 100644 index 7a276c1fe..000000000 --- a/module/plugins/hoster/Share4webCom.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.hoster.UnibytesCom import UnibytesCom -from module.plugins.internal.SimpleHoster import create_getInfo - - -class Share4WebCom(UnibytesCom): - __name__ = "Share4WebCom" - __type__ = "hoster" - __version__ = "0.11" - - __pattern__ = r'https?://(?:www\.)?share4web\.com/get/\w+' - - __description__ = """Share4web.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - HOSTER_DOMAIN = "share4web.com" - - -getInfo = create_getInfo(Share4WebCom) diff --git a/module/plugins/hoster/Vipleech4UCom.py b/module/plugins/hoster/Vipleech4UCom.py new file mode 100644 index 000000000..2ae41b942 --- /dev/null +++ b/module/plugins/hoster/Vipleech4UCom.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo + + +class Vipleech4UCom(DeadHoster): + __name__ = "Vipleech4UCom" + __type__ = "hoster" + __version__ = "0.20" + + __pattern__ = r'http://(?:www\.)?vipleech4u\.com/manager\.php' + + __description__ = """Vipleech4u.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] + + +getInfo = create_getInfo(Vipleech4UCom) diff --git a/module/plugins/hoster/Vipleech4uCom.py b/module/plugins/hoster/Vipleech4uCom.py deleted file mode 100644 index 2ae41b942..000000000 --- a/module/plugins/hoster/Vipleech4uCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - - -class Vipleech4UCom(DeadHoster): - __name__ = "Vipleech4UCom" - __type__ = "hoster" - __version__ = "0.20" - - __pattern__ = r'http://(?:www\.)?vipleech4u\.com/manager\.php' - - __description__ = """Vipleech4u.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - - -getInfo = create_getInfo(Vipleech4UCom) -- cgit v1.2.3