summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-03 14:25:01 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-03 14:25:01 +0200
commite09de9962a5c94eeabbf65616ea34a2ec54f7166 (patch)
tree42715f842063fe478edb35da1a29f2b67b548e54 /module/plugins
parent[ExternalScripts] Fix https://github.com/pyload/pyload/issues/1307 (diff)
parentSome issue in keep2share.cc #1236 (diff)
downloadpyload-e09de9962a5c94eeabbf65616ea34a2ec54f7166.tar.xz
Merge pull request #1301 from saintego/patch-5
Some issue in keep2share.cc #1236
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hoster/Keep2ShareCc.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py
index 5afa87a4a..296226e3c 100644
--- a/module/plugins/hoster/Keep2ShareCc.py
+++ b/module/plugins/hoster/Keep2ShareCc.py
@@ -22,7 +22,7 @@ class Keep2ShareCc(SimpleHoster):
("Walter Purcaro", "vuolter@gmail.com")]
- URL_REPLACEMENTS = [(__pattern__ + ".*", "http://k2s.cc/file/\g<ID>")]
+ URL_REPLACEMENTS = [(__pattern__ + ".*", "http://keep2s.cc/file/\g<ID>")]
NAME_PATTERN = r'File: <span>(?P<N>.+)</span>'
SIZE_PATTERN = r'Size: (?P<S>[^<]+)</div>'
@@ -30,7 +30,7 @@ class Keep2ShareCc(SimpleHoster):
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 = r'"(.+?url.html?file=.+?)"|window\.location\.href = \'(.+?)\';'
+ LINK_FREE_PATTERN = r'"([^"]+url.html\?file=.+?)"|window\.location\.href = \'(.+?)\';'
LINK_PREMIUM_PATTERN = r'window\.location\.href = \'(.+?)\';'
CAPTCHA_PATTERN = r'src="(/file/captcha\.html.+?)"'
@@ -67,8 +67,10 @@ class Keep2ShareCc(SimpleHoster):
def handleFree(self, pyfile):
- self.fid = re.search(r'<input type="hidden" name="slow_id" value="(.+?)">', self.html).group(1)
+ 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.checkErrors()
@@ -77,7 +79,7 @@ class Keep2ShareCc(SimpleHoster):
if m is None:
self.handleCaptcha()
- self.wait(30)
+ self.wait(31)
self.html = self.load(pyfile.url)
@@ -89,17 +91,20 @@ class Keep2ShareCc(SimpleHoster):
def handleCaptcha(self):
- recaptcha = ReCaptcha(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)
m = re.search(self.CAPTCHA_PATTERN, self.html)
+ self.logDebug("CAPTCHA_PATTERN found %s" % m)
if m:
- captcha_url = urljoin("http://k2s.cc/", m.group(1))
+ captcha_url = urljoin("http://keep2s.cc/", m.group(1))
post_data['CaptchaForm[code]'] = self.decryptCaptcha(captcha_url)
else:
+ recaptcha = ReCaptcha(self)
response, challenge = recaptcha.challenge()
post_data.update({'recaptcha_challenge_field': challenge,
'recaptcha_response_field' : response})