diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 09:06:05 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 09:09:53 +0200 |
commit | 23ae563604dca1dae262fbc598154b99b2f1eae8 (patch) | |
tree | 1540b988d133c052bf0d6e7f26f02324db6f944a /module/plugins/hoster/CrockoCom.py | |
parent | [MovReelCom] Fixed LINK_PATTERN (diff) | |
download | pyload-23ae563604dca1dae262fbc598154b99b2f1eae8.tar.xz |
Update plugins after CaptchaService and XFileSharingPro changes
Diffstat (limited to 'module/plugins/hoster/CrockoCom.py')
-rw-r--r-- | module/plugins/hoster/CrockoCom.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 80d9b3d61..8888802a9 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -22,7 +22,6 @@ class CrockoCom(SimpleHoster): OFFLINE_PATTERN = r"<h1>Sorry,<br />the page you're looking for <br />isn't here.</h1>|File not found" CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';") - CAPTCHA_KEY_PATTERN = re.compile(r'Recaptcha.create\("([^"]+)"') FORM_PATTERN = r'<form method="post" action="([^"]+)">(.*?)</form>' FORM_INPUT_PATTERN = r'<input[^>]* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>' @@ -43,10 +42,10 @@ class CrockoCom(SimpleHoster): else: break - m = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - if m is None: - self.parseError('Captcha KEY') - captcha_key = m.group(1) + recaptcha = ReCaptcha(self) + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha captcha key not found") m = re.search(self.FORM_PATTERN, self.html, re.DOTALL) if m is None: @@ -54,14 +53,12 @@ class CrockoCom(SimpleHoster): action, form = m.groups() inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - recaptcha = ReCaptcha(self) - for _ in xrange(5): inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) self.download(action, post=inputs) check = self.checkDownload({ - "captcha_err": self.CAPTCHA_KEY_PATTERN + "captcha_err": recaptcha.KEY_AJAX_PATTERN }) if check == "captcha_err": |