Recaptcha Cracker
Description
RecaptchaCracker is a tool designed to automate the resolution of Captchas on web pages using Seleniumbase. It allows you to solve "reCaptcha v2" captchas using audio transcription, making it easy to integrate into web automation workflows.
Features
- Automated resolution of reCAPTCHA V2 captchas on web pages.
- Automated resolution of text captchas on web pages.
- Flexible configuration of the number of attempts to solve audio captchas.
- Easy integration into web automation workflows.
Requirements
- Python 3.10+
- Seleniumbase
- Pydub
- SpeechRecognition
- easyocr
- requests
- opencv
- verbose-terminal
[!IMPORTANT] If you're getting an error related to FFmpeg not being installed or in your PATH, get it here: https://ffmpeg.org/download.html If the error persists, make sure FFmpeg is properly installed for your OS and in your PATH.
Installation
pip install recaptcha-cracker
Usage
Resolving reCAPTCHA V2
- Import the necessary class to your Python script:
from recaptcha_cracker import RecaptchaV2
- Initialize a RecaptchaV2 object with a SeleniumBase Driver object:
from seleniumbase import Driver
# Inicializa el objeto Driver
driver = Driver()
# Carga la página web
driver.get("https://www.google.com/recaptcha/api2/demo")
# Inicializa el objeto RecaptchaV2
recaptcha = RecaptchaV2(driver)
- Use the cracker() method to resolve a reCAPTCHA on a web page:
checked_status = recaptcha.cracker(selector='//*[@id="recaptcha-demo"]/div/div/iframe')
- If the reCAPTCHA is successfully resolved, the method will return True. Otherwise, it will return False.
Resolving text captchas
- Import the necessary class to your Python script:
from recaptcha_cracker import TextCaptcha
- Initialize a TextCaptcha object:
text_captcha = TextCaptcha(image_path='captcha.png', session=None, processing=True, kernel=(2, 2), verbose=True)
- Use the
download_and_read_imagemethod to download and read a captcha image from a URL:
captcha_text = text_captcha.download_and_read_image(url='https://example.com/captcha.png')
- Use the
decode_and_read_imagemethod to decode and read a base64 encoded captcha image:
base64_image = 'data:image/png;base64,...'
captcha_text = text_captcha.decode_and_read_image(base64_image=base64_image)
- Use the
capture_and_read_imagemethod to capture and read a captcha image from a web page element:
captcha_text = text_captcha.capture_and_read_image(driver, element='//img[@id="captcha_image"]')
- The methods return the decoded captcha text if successful, or None if there was an error.
Contributions
If you'd like to contribute, please see the CONTRIBUTING.md file.
License
This project is under the MIT License. See the LICENSE file for more details.
Inspiration
This project was inspired by the project https://github.com/thicccat688/selenium-recaptcha-solver, created by user "thicccat688". The original library provides a robust solution to solve reCAPTCHA v2 challenges using Selenium and speech recognition services. By studying its implementation and design, I was able to better understand how to address captcha resolution challenges in web automation environments.
I thank the team behind selenium-recaptcha-solver for their excellent work and contributions to the open source community.
Metadata
Release files for recaptcha-cracker 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| recaptcha_cracker-0.2.1.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| recaptcha_cracker-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / recaptcha_cracker-0.2.1.tar.gz
| Download URL | recaptcha_cracker-0.2.1.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99fcc13fc10492c9dddbac9f8c38795ccf1ed22acc643f86864b81b25dcf316c
|
|
BLAKE2b-256 checksum How to use checksums |
392bbba2a11ad377248939b896f6a3f27611ffb4638c56a56ef0e4281e69af0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.11
|
Release files / recaptcha_cracker-0.2.1-py3-none-any.whl
| Download URL | recaptcha_cracker-0.2.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88c51807943b45d281a92b13b3626a916d15a9d153b6078be8705826ccd035a5
|
|
BLAKE2b-256 checksum How to use checksums |
1ff558b16efe97376e25b086b87ab136431cc79e95f792b288c59c46387813b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.11
|