Python module to help solve captchas with Capmonster, 2captcha and Anticaptcha API's!
Project description
Captcha Tools
Python module to help solve captchas with Capmonster, 2Captcha and Anticaptcha API's!
Install
pip3 install captchatools
To update
pip3 install -U captchatools
How to use
import captchatools
solver = captchatools.captcha_harvesters(solving_site="capmonster", api_key="YOUR API KEY", sitekey="SITEKEY", captcha_url="https://www.google.com/recaptcha/api2/demo")
captcha_answer = solver.get_token()
or
from captchatools import captcha_harvesters, exceptions
solver = captcha_harvesters(solving_site=1, api_key="YOUR API KEY", sitekey="SITEKEY", captcha_url="https://www.google.com/recaptcha/api2/demo")
captcha_answer = solver.get_token()
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
api_key | true | String | - | The API Key for the captcha solving site |
solving_site | true | String (name of site) or int (site ID) | "capmonster" | Captcha solving site |
sitekey | true | String | - | Sitekey from the site where captcha is loaded |
captcha_url | true | String | - | URL where the captcha is located |
captcha_type | false | String | "v2" | Type of captcha you are solving. Either captcha v2 , v3 or hcaptcha (hcap works aswell) |
invisible_captcha | false | bool | false | If the captcha is invisible or not. This param is only required when solving invisible captchas |
min_score | false | double | 0.7 | Minimum score for v3 captchas. This param is only required when solving V3 and it needs a higher / lower score |
action | false | String | "verify" | Action that is associated with the V3 captcha. This param is only required when solving V3 captchas |
Supported Sites
Site-Specific Support:
Site | Site ID | Captcha Types Supported | Task Types Supported |
---|---|---|---|
Capmonster | 1 | Recaptcha V2, Recaptcha V3, HCaptcha |
RecaptchaV2TaskProxyless, RecaptchaV3TaskProxyless, HCaptchaTaskProxyless |
Anticaptcha | 2 | Recaptcha V2, Recaptcha V3, HCaptcha |
RecaptchaV2TaskProxyless, RecaptchaV3TaskProxyless, HCaptchaTaskProxyless |
2Captcha | 3 | Recaptcha V2, Recaptcha V3, HCaptcha |
- |
Recommendations
- For 2Captcha, don't run more than 60 tasks per API key.
- Handle exceptions appropriately.
- If a
NoBalanceException
is thrown, tasks should stop. Some sites will temporarily ban IP's if constant requests come in.
- If a
Exceptions
Exception | Raised |
---|---|
NoBalanceException |
Balance is below 0 for captcha solving site |
WrongAPIKeyExceptionException |
Incorrect API Key for captcha solving site |
WrongSitekeyException |
Incorrect sitekey |
NoHarvesterException |
When the user did not / incorrectly chose a captcha harvester. Refer to the guide |
from captchatools import captcha_harvesters, exceptions as captchaExceptions
try:
...
except captchaExceptions.NoBalanceException:
print("No balance.")
or
import captchatools
try:
...
except captchatools.NoBalanceException:
print("No balance.")
TO DO
- [] Document code better
- [] 2Captcha
- [] Clean up code
- [] Proxy support
- [] Cookie support
- [] User Agent Support
- [] Different type of captchas
- [] Anticaptcha
- [] Clean up code
- [] Proxy support
- [] Cookie support
- [] User Agent Support
- [] Different type of captchas
- [] Capmonster
- [] Clean up code
- [] Proxy support
- [] Cookie support
- [] User Agent Support
- [] Different type of captchas
- [] Add DeathByCaptcha
- [] Release in Go
- [] Allow for refunds
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for captchatools-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14d4a52dada7c86e8c884d6587cdc4e0b930c42c639c73941dcdc4667f9b50b8 |
|
MD5 | 1b46a837b734be7b6eb3599afb0ead5b |
|
BLAKE2b-256 | c5ca40df4161c73e12558690a41fc9a34c9497c24e6d95a44fab7e3c8b2a4ca6 |