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/TurbobitNet.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/TurbobitNet.py')
-rw-r--r-- | module/plugins/hoster/TurbobitNet.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 13c730b05..999430bc2 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -36,8 +36,8 @@ class TurbobitNet(SimpleHoster): LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r"<div id='timeout'>(\d+)<" - CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.+?)"' + + CAPTCHA_URL_PATTERN = r'<img alt="Captcha" src="(.+?)"' def handleFree(self): @@ -71,12 +71,13 @@ class TurbobitNet(SimpleHoster): if inputs['captcha_type'] == 'recaptcha': recaptcha = ReCaptcha(self) - m = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - captcha_key = m.group(1) if m else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c' - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge( - captcha_key) + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha captcha key not found") + + inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) else: - m = re.search(self.CAPTCHA_SRC_PATTERN, self.html) + m = re.search(self.CAPTCHA_URL_PATTERN, self.html) if m is None: self.parseError('captcha') captcha_url = m.group(1) |