KhomZ / CAPTCHA-generator

This repo is mainly focussed on how we can create captcha using python. We will use python's module captcha. Captchas are basically of two types: captcaha audio and image captcha.
0 stars 0 forks source link

Issue: for alphabets audio CAPTCHA #1

Open KhomZ opened 2 years ago

KhomZ commented 2 years ago

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'

KhomZ commented 2 years ago

''' @author: KhomZ ''' from captcha.image import ImageCaptcha from captcha.audio import AudioCaptcha

image = ImageCaptcha() audio = AudioCaptcha()

data = audio.generate('1234')

audio.write('1234', '1.wav')

data = audio.generate('abcd') audio.write('abcd', '1.wav')

data = image.generate('1234')

image.write('1234', '1.png')

data = image.generate('abcd') image.write('abcd', '1.png')