Add functions to Captcha class for retrieving the audio and image captcha representations using the corresponding Tasks cookie jar

master
Sven Slootweg 12 years ago
parent b1c0bf1a26
commit 414aa6ba52

@ -65,11 +65,19 @@ class Captcha():
image = None
audio = None
text = None
task = None
def __init__(image=None, audio=None, text=None):
def __init__(self, task, image=None, audio=None, text=None):
self.image = image
self.audio = audio
self.text = text
self.task = task
def get_image(self):
return self.task.fetch_page(self.image)
def get_audio(self):
return self.task.fetch_page(self.audio)
def unescape(s):
return HTMLParser.unescape.__func__(HTMLParser, s)

Loading…
Cancel
Save