Open KhomZ opened 2 years ago
''' @author: KhomZ ''' from captcha.image import ImageCaptcha from captcha.audio import AudioCaptcha
image = ImageCaptcha() audio = AudioCaptcha()
data = audio.generate('abcd') audio.write('abcd', '1.wav')
data = image.generate('abcd') image.write('abcd', '1.png')
C:\Users\ACER\PycharmProjects\CAPTCHA\venv\Scripts\python.exe C:/Users/ACER/PycharmProjects/CAPTCHA/main.py Traceback (most recent call last): File "C:\Users\ACER\PycharmProjects\CAPTCHA\main.py", line 14, in
data = audio.generate('abcd')
File "C:\Users\ACER\PycharmProjects\CAPTCHA\venv\lib\site-packages\captcha\audio.py", line 271, in generate
body = self.create_wave_body(chars)
File "C:\Users\ACER\PycharmProjects\CAPTCHA\venv\lib\site-packages\captcha\audio.py", line 247, in create_wave_body
voices.append(self._twist_pick(key))
File "C:\Users\ACER\PycharmProjects\CAPTCHA\venv\lib\site-packages\captcha\audio.py", line 209, in _twist_pick
voice = random.choice(self._cache[key])
KeyError: 'a'