summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/Keep2ShareCc.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/Keep2ShareCc.py')
-rw-r--r--module/plugins/hoster/Keep2ShareCc.py32
1 files changed, 16 insertions, 16 deletions
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<ID>\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'<input type="hidden" name="slow_id" value="(.+?)">', 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)