Getting Started
Welcome to the Recaptcha Cracker documentation! This guide will help you get up and running with Recaptcha Cracker, a tool designed to automate the resolution of reCAPTCHA v2 and text captchas on web pages.
Installation
To install Recaptcha Cracker, you'll need Python 3.10+ and pip. You can install the package via pip with the following command:
pip install recaptcha-cracker
Requirements
Make sure you have the following dependencies installed:
- Seleniumbase
- Pydub
- SpeechRecognition
- EasyOCR
- OpenCV
- Requests
- verbose-terminal
IMPORTANT
If you're getting an error related to FFmpeg not being installed or in your PATH, get it here: FFmpeg Download. if the error persists, Ensure FFmpeg is properly installed for your OS and in your PATH.
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', processing=True, kernel=(2, 2), verbose=True)
- Use the
download_and_read_image
method 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_image
method 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_image
method 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.
Next Steps
Explore the API Reference for detailed information on all available methods and classes.
If you encounter any issues or have questions, feel free to open an issue on GitHub or consult the Contributing Guide for ways to get involved with the project.
Happy captcha cracking!