Revision: 6069 Author: nicdumz Date: 2008-11-06 01:49:17 +0000 (Thu, 06 Nov 2008)
Log Message: ----------- Raising CaptchaError when a ReCaptcha is found, instead of spitting out HTML
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-11-06 01:00:13 UTC (rev 6068) +++ trunk/pywikipedia/wikipedia.py 2008-11-06 01:49:17 UTC (rev 6069) @@ -4379,6 +4379,9 @@ url = self.protocol() + '://' + self.hostname() + self.captcha_image_address(id) answer = ui.askForCaptcha(url) return {'id':id, 'answer':answer} + Recaptcha = re.compile('<script type="text/javascript" src="http://api%5C.recaptcha%5C.net/%5B%5E%22%5D*%22%3E</script>') + if Recaptcha.search(data): + raise wikipedia.CaptchaError('We have been prompted for a ReCaptcha, but pywikipedia does not yet support ReCaptchas') return None
def postForm(self, address, predata, sysop=False, cookies = None):