Anycaptcha
A unified Python API for CAPTCHA solving services
Install / Use
/learn @alenkimov/AnycaptchaREADME
anycaptcha
pip install anycaptcha
anycaptcha is a unified Python API for CAPTCHA solving services.
Special thanks to unicaps lib
Key Features
- A unified Python interface that is independent of the service used
- Uses native service protocol/endpoints (eg, no needs in patching hosts file)
- Modern asynchronous client
- Supports 10 types of CAPTCHAs
- Written Pythonic way and is intended for humans
- Supports proxies in any format thanks to better-proxy
Supports 9 CAPTCHA solving services:
- capmonster.cloud
- 2captcha.com (rucaptcha.com)
- anti-captcha.com
- azcaptcha.com
- cap.guru
- deathbycaptcha.com
- capsolver.com
- multibot.in
TODO
- _post_init используется только для net настройки капч и транспорта - от него нужно избавиться и сделать настройку более прозрачной
- вместо if elif в parse_response должнен быть словарь {класс ошибки: {сет из кодов ошибок}}
- вместо вручную сделанного енама Service и словаря SOLVING_SERVICE это должно автоматом генерится как-то. Например у класса сервиса должно быть поле service_name
Example
from pathlib import Path
from anycaptcha import Solver, Service
API_KEY = '<PLACE_YOUR_API_KEY_HERE>'
async def main():
async with Solver(Service.TWOCAPTCHA, API_KEY) as solver:
solved = await solver.solve_image_captcha(
Path("captcha.jpg"),
is_phrase=False,
is_case_sensitive=True
)
print(f'CAPTCHA text: {solved.solution.text}')
await solved.report_good()
Supported CAPTCHAs / Services
| Service | Image | Text | reCAPTCHA v2 | reCAPTCHA v3 | FunCaptcha | KeyCAPTCHA | Geetest | Geetest v4 | Capy | |-----------------------------------------------------------------------------|:-----:|:----:|:--------------------------------------------------------------------:|:---------------------------------------------------------------:|:-------------------------------------------------------------------------------------------:|:-----------------------------------------:|:------------------------------------------:|:---------------------------------------------:|:----------------------------:| | capmonster.cloud | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | | 2captcha.com | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | anti-captcha.com | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | | azcaptcha.com | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | | cap.guru | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | | deathbycaptcha.com | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
Image CAPTCHA
| Service | Regular | Case Sensitive | Phrase | Numbers only | Letters only | Math | Length | Language | Comment for worker | |-----------------------------------------------------------------------------|:-------:|:--------------:|:------:|:------------:|:------------:|:----:|:------:|:--------------:|:------------------:| | capmonster.cloud | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | Latin | ✅ | | 2captcha.com | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | Cyrillic/Latin | ✅ | | anti-captcha.com | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | Latin | ✅ | | azcaptcha.com | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | Latin | ✅ | | cap.guru | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | Latin | ✅ | | deathbycaptcha.com | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | Latin | ❌ |
Text CAPTCHA
Text Captcha is a type of captcha that is represented as text and doesn't contain images. Usually you have to answer a question to pass the verification. For example: "If tomorrow is Saturday, what day is today?".
| Service | Language | |-----------------------------------------------------------------------------|:----------------:| | 2captcha.com | English, Russian |
reCAPTCHA v2
| Service | Regular | Invisible | Enterprise | Google service<sup>1</sup> | Proxy<sup>2</sup> | Cookies<sup>3</sup> | User-Agent<sup>4</sup> | |-----------------------------------------------------------------------------|:-------:|:---------:|:----------:|:--------------------------:|:-----------------:|:-------------------:|:----------------------:| | capmonster.cloud (recommended) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | 2captcha.com | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | anti-captcha.com | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | azcaptcha.com | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | | cap.guru | ✅ | ✅ | ❌ | ✅
