From b0a9a19f624af30d49ac56a51d38a70984635879 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Fri, 5 Jun 2015 18:43:53 +0300 Subject: Update Keep2ShareCc.py --- module/plugins/hoster/Keep2ShareCc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index fb94d12c4..19a8f2ba6 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class Keep2ShareCc(SimpleHoster): __name__ = "Keep2ShareCc" __type__ = "hoster" - __version__ = "0.22" + __version__ = "0.23" __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -23,7 +23,7 @@ class Keep2ShareCc(SimpleHoster): URL_REPLACEMENTS = [(__pattern__ + ".*", "http://keep2s.cc/file/\g")] - NAME_PATTERN = r'File: (?P.+)' + 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' -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/hoster/Keep2ShareCc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index 19a8f2ba6..d90466904 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -55,7 +55,7 @@ class Keep2ShareCc(SimpleHoster): 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 + #: 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(':')))) @@ -69,8 +69,8 @@ class Keep2ShareCc(SimpleHoster): self.fid = re.search(r'', self.html).group(1) self.html = self.load(pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - # self.logDebug(self.fid) - # self.logDebug(pyfile.url) + #: self.logDebug(self.fid) + #: self.logDebug(pyfile.url) self.checkErrors() -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hoster/Keep2ShareCc.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index d90466904..c743f4fc9 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class Keep2ShareCc(SimpleHoster): __name__ = "Keep2ShareCc" __type__ = "hoster" - __version__ = "0.23" + __version__ = "0.24" __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -39,11 +39,11 @@ class Keep2ShareCc(SimpleHoster): 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): + def check_errors(self): m = re.search(self.TEMP_ERROR_PATTERN, self.html) if m: self.info['error'] = m.group(1) - self.wantReconnect = True + self.want_reconnect = True self.retry(wait_time=30 * 60, reason=m.group(0)) m = re.search(self.ERROR_PATTERN, self.html) @@ -53,30 +53,30 @@ class Keep2ShareCc(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: - self.logDebug("Hoster told us to wait for %s" % m.group(1)) + self.log_debug("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.want_reconnect = True self.retry(wait_time=wait_time, reason="Please wait to download this file") self.info.pop('error', None) - def handleFree(self, pyfile): + def handle_free(self, pyfile): self.fid = re.search(r'', self.html).group(1) self.html = self.load(pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - #: self.logDebug(self.fid) - #: self.logDebug(pyfile.url) + #: self.log_debug(self.fid) + #: self.log_debug(pyfile.url) - self.checkErrors() + self.check_errors() m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: - self.handleCaptcha() + self.handle_captcha() self.wait(31) self.html = self.load(pyfile.url) @@ -87,20 +87,20 @@ class Keep2ShareCc(SimpleHoster): self.link = m.group(1) - def handleCaptcha(self): + def handle_captcha(self): post_data = {'free' : 1, 'freeDownloadRequest': 1, 'uniqueId' : self.fid, 'yt0' : ''} m = re.search(r'id="(captcha\-form)"', self.html) - self.logDebug("captcha-form found %s" % m) + self.log_debug("captcha-form found %s" % m) m = re.search(self.CAPTCHA_PATTERN, self.html) - self.logDebug("CAPTCHA_PATTERN found %s" % m) + self.log_debug("CAPTCHA_PATTERN found %s" % m) if m: captcha_url = urlparse.urljoin("http://keep2s.cc/", m.group(1)) - post_data['CaptchaForm[code]'] = self.decryptCaptcha(captcha_url) + post_data['CaptchaForm[code]'] = self.decrypt_captcha(captcha_url) else: recaptcha = ReCaptcha(self) response, challenge = recaptcha.challenge() @@ -110,9 +110,9 @@ class Keep2ShareCc(SimpleHoster): self.html = self.load(self.pyfile.url, post=post_data) if 'verification code is incorrect' not in self.html: - self.correctCaptcha() + self.correct_captcha() else: - self.invalidCaptcha() + self.invalid_captcha() getInfo = create_getInfo(Keep2ShareCc) -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/hoster/Keep2ShareCc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index c743f4fc9..7e34550d9 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -55,7 +55,7 @@ class Keep2ShareCc(SimpleHoster): if m: self.log_debug("Hoster told us to wait for %s" % m.group(1)) - #: string to time convert courtesy of https://stackoverflow.com/questions/10663720 + #: 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(':')))) @@ -69,8 +69,8 @@ class Keep2ShareCc(SimpleHoster): self.fid = re.search(r'', self.html).group(1) self.html = self.load(pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - #: self.log_debug(self.fid) - #: self.log_debug(pyfile.url) + # self.log_debug(self.fid) + # self.log_debug(pyfile.url) self.check_errors() -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hoster/Keep2ShareCc.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index 7e34550d9..a4faa72d0 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -11,6 +11,7 @@ class Keep2ShareCc(SimpleHoster): __name__ = "Keep2ShareCc" __type__ = "hoster" __version__ = "0.24" + __status__ = "stable" __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] -- cgit v1.2.3 From 027cb529d79558de19c47da88a782b31745a65c9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 21 Jul 2015 22:53:37 +0200 Subject: New Captcha skeleton --- module/plugins/hoster/Keep2ShareCc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index a4faa72d0..4fa3f121f 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -101,7 +101,7 @@ class Keep2ShareCc(SimpleHoster): self.log_debug("CAPTCHA_PATTERN found %s" % m) if m: captcha_url = urlparse.urljoin("http://keep2s.cc/", m.group(1)) - post_data['CaptchaForm[code]'] = self.decrypt_captcha(captcha_url) + post_data['CaptchaForm[code]'] = self.captcha.decrypt_image(captcha_url) else: recaptcha = ReCaptcha(self) response, challenge = recaptcha.challenge() @@ -111,9 +111,9 @@ class Keep2ShareCc(SimpleHoster): self.html = self.load(self.pyfile.url, post=post_data) if 'verification code is incorrect' not in self.html: - self.correct_captcha() + self.captcha.correct() else: - self.invalid_captcha() + self.captcha.invalid() getInfo = create_getInfo(Keep2ShareCc) -- cgit v1.2.3 From 6af9b38a8d5d49355b85aef6ddd003605d6bba05 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Jul 2015 23:44:45 +0200 Subject: Improve Captcha --- module/plugins/hoster/Keep2ShareCc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index 4fa3f121f..41538da94 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -3,7 +3,7 @@ import re import urlparse -from module.plugins.internal.ReCaptcha import ReCaptcha +from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -101,7 +101,7 @@ class Keep2ShareCc(SimpleHoster): self.log_debug("CAPTCHA_PATTERN found %s" % m) if m: captcha_url = urlparse.urljoin("http://keep2s.cc/", m.group(1)) - post_data['CaptchaForm[code]'] = self.captcha.decrypt_image(captcha_url) + post_data['CaptchaForm[code]'] = self.captcha.decrypt(captcha_url) else: recaptcha = ReCaptcha(self) response, challenge = recaptcha.challenge() -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hoster/Keep2ShareCc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/Keep2ShareCc.py') diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index 41538da94..bf4b157cb 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -11,7 +11,7 @@ class Keep2ShareCc(SimpleHoster): __name__ = "Keep2ShareCc" __type__ = "hoster" __version__ = "0.24" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -44,7 +44,7 @@ class Keep2ShareCc(SimpleHoster): m = re.search(self.TEMP_ERROR_PATTERN, self.html) if m: self.info['error'] = m.group(1) - self.want_reconnect = True + self.wantReconnect = True self.retry(wait_time=30 * 60, reason=m.group(0)) m = re.search(self.ERROR_PATTERN, self.html) @@ -60,7 +60,7 @@ class Keep2ShareCc(SimpleHoster): ftr = [3600, 60, 1] wait_time = sum(a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))) - self.want_reconnect = True + self.wantReconnect = True self.retry(wait_time=wait_time, reason="Please wait to download this file") self.info.pop('error', None) -- cgit v1.2.3