Turnstile / README_bak.md
llzai's picture
Upload 11 files
fd831ef verified

Cloudflare - Turnstile Solver NEW

πŸ“’ Connect with Us

Python Platform License

❀️ Support the Project If you find this collection valuable and appreciate the effort involved in obtaining and sharing these insights, please consider supporting the project. Your contribution helps keep this resource updated and allows for further exploration.

You can show your support via:

Cryptocurrency:

  • EVM: 0xeba21af63e707ce84b76a87d0ba82140048c057e (ETH,BNB,etc)
  • TRON: TEfECnyz5G1EkFrUqnbFcWLVdLvAgW9Raa
  • TON: UQCJ7KC2zxV_zKwLahaHf9jxy0vsWRcvQFie_FUBJW-9LcEW
  • BTC: bc1qdag98y5yahs6wf7rsfeh4cadsjfzmn5ngpjrcf
  • SOL: EwXXR4VqmWSNz1sjhZ8qcQ882i4URwAwhixSPEbDzyv6
  • SUI: 0x76da9b74c61508fbbd0b3e1989446e036b0622f252dd8d07c3fce759b239b47d

πŸ™ Thank you for your support!

A Python-based Turnstile solver using the patchright and camoufox libraries, featuring multi-threaded execution, API integration, and support for different browsers. It solves CAPTCHAs quickly and efficiently, with customizable configurations and detailed logging.

πŸš€ Features

  • Multi-threaded execution - Solve multiple CAPTCHAs simultaneously
  • Multiple browser support - Chromium, Chrome, Edge, and Camoufox
  • Proxy support - Use proxies from proxies.txt file
  • Random browser configurations - Rotate User-Agent and Sec-CH-UA headers
  • Detailed logging - Comprehensive debug information
  • REST API - Easy integration with other applications
  • Database storage - SQLite database for result persistence
  • Automatic cleanup - Old results are automatically cleaned up
  • Image blocking - Optimized performance by blocking unnecessary images

πŸ”§ Configuration

Browser Configurations

The solver supports various browser configurations with realistic User-Agent strings and Sec-CH-UA headers:

  • Chrome (versions 136-139)
  • Edge (versions 137-139)
  • Avast (versions 137-138)
  • Brave (versions 137-139)

Proxy Format

Add proxies to proxies.txt in the following formats:

ip:port
ip:port:username:password
scheme://ip:port
scheme://username:password@ip:port

❗ Disclaimers

I am not responsible for anything that may happen, such as API Blocking, IP ban, etc.
This was a quick project that was made for fun and personal use if you want to see further updates, star the repo & create an "issue" here

βš™οΈ Installation Instructions

Ensure Python 3.8+ is installed on your system.

1. Create a Python virtual environment:

python -m venv venv

2. Activate the virtual environment:

On Windows:

venv\Scripts\activate

On macOS/Linux:

source venv/bin/activate

3. Install required dependencies:

pip install -r requirements.txt

4. Select the browser to install:

You can choose between Chromium, Chrome, Edge or Camoufox:

To install Chromium:

python -m patchright install chromium

To install Chrome:

  • On macOS/Windows: Click here
  • On Linux (Debian/Ubuntu-based):
apt update
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install -y ./google-chrome-stable_current_amd64.deb
apt -f install -y  # Fix dependencies if needed
rm ./google-chrome-stable_current_amd64.deb

To install Edge:

python -m patchright install msedge

To install Camoufox:

python -m camoufox fetch

5. Start testing:

Run the script (Check πŸ”§ Command line arguments for better setup):

python api_solver.py

πŸ”§ Command line arguments

Parameter Default Type Description
--no-headless False boolean Runs the browser with GUI (disable headless mode). By default, headless mode is enabled.
--useragent None string Specifies a custom User-Agent string for the browser. (No need to set if camoufox used)
--debug False boolean Enables or disables debug mode for additional logging and troubleshooting.
--browser_type chromium string Specify the browser type for the solver. Supported options: chromium, chrome, msedge, camoufox
--thread 4 integer Sets the number of browser threads to use in multi-threaded mode.
--host 0.0.0.0 string Specifies the IP address the API solver runs on.
--port 6080 integer Sets the port the API solver listens on.
--proxy False boolean Select a random proxy from proxies.txt for solving captchas
--random False boolean Use random User-Agent and Sec-CH-UA configuration from pool
--browser None string Specify browser name to use (e.g., chrome, firefox)
--version None string Specify browser version to use (e.g., 139, 141)

πŸ“‘ API Documentation

Solve turnstile

GET /turnstile?url=https://example.com&sitekey=0x4AAAAAAA

Request Parameters:

Parameter Type Description Required
url string The target URL containing the CAPTCHA. (e.g., https://example.com) Yes
sitekey string The site key for the CAPTCHA to be solved. (e.g., 0x4AAAAAAA) Yes
action string Action to trigger during CAPTCHA solving, e.g., login No
cdata string Custom data that can be used for additional CAPTCHA parameters. No

Response:

If the request is successfully received, the server will respond with a task_id for the CAPTCHA solving task:

{
  "task_id": "d2cbb257-9c37-4f9c-9bc7-1eaee72d96a8"
}

Get Result

GET /result?id=f0dbe75b-fa76-41ad-89aa-4d3a392040af

Request Parameters:

Parameter Type Description Required
id string The unique task ID returned from the /turnstile request. Yes

Response:

If the CAPTCHA is solved successfully, the server will respond with the following information:

{
  "status": "ready",
  "value": "0.KBtT-r",
  "elapsed_time": 7.625
}

Error Responses:

{
  "status": "processing"
}
{
  "status": "fail",
  "value": "CAPTCHA_FAIL",
  "elapsed_time": 30.0
}

πŸ› Troubleshooting

Common Issues

  1. Browser not found: Make sure you've installed the required browser using the installation instructions
  2. Permission denied: Run with appropriate permissions or check file permissions
  3. Port already in use: Change the port using --port argument
  4. Proxy connection failed: Check proxy format and availability

Debug Mode

Enable debug mode for detailed logging:

python api_solver.py --debug

πŸ“Š Performance

  • Average solving time: 5-15 seconds
  • Success rate: 95%+ (depending on site complexity)
  • Memory usage: ~50-100MB per browser thread
  • CPU usage: Moderate (depends on thread count)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is for educational purposes only. Use at your own risk.