Skip to content

Commit

Permalink
Merge branch 'polukhin_audio' of github.com:2captcha/2captcha-python …
Browse files Browse the repository at this point in the history
…into polukhin_audio
  • Loading branch information
iamarkadiypolukhin committed Oct 6, 2023
2 parents ad12a68 + adcd2bf commit 73974b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
```

### Audio Captcha
To bypass an audio captcha (mp3 formats only) use the following method. Language must be in foramt lang = 'en'. Acceptable languages are "en", "ru", "de", "el", "pt".
To bypass an audio captcha (mp3 formats only) use the following method.
You must provife the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".

```python
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
# OR
Expand Down
Binary file added examples/audio/example.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion twocaptcha/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def audio(self, file, lang, **kwargs):
#"method":"audio", #method

if not ((not '.' in file and len(file) > 50) or (file.endswith(".mp3") and file.startswith("http"))):
raise ValidationException('File has not .mp3 base64 str. You must send .mp3 file or base64 str')
raise ValidationException('File extension is not .mp3 or it is not a base64 string.')

method = self.get_method(file)
method['method'] = "audio"
Expand Down

0 comments on commit 73974b8

Please sign in to comment.