A Python-based Turnstile solver using the patchright library, featuring multi-threaded execution, API integration, and support for different browsers. It solves CAPTCHAs quickly and efficiently, with customizable configurations and detailed logging.
    
    
    π ChangeLog
    Β·
    
- USDT (TRC20): TWXNQCnJESt6gxNMX5oHKwQzq4gsbdLNRh
- USDT (Arbitrum One): 0xd8fd1e91c8af318a74a0810505f60ccca4ca0f8c
- BTC: 13iiMaYFpCfNdcyFycSdSVmD2yfQciD7AQ
- LTC: LSrLQe2dfpDhGgVvDTRwW72fSyC9VsXp9g
- 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
- 
Ensure Python 3.8+ is installed on your system. 
- 
Create a Python virtual environment: python -m venv venv 
- 
Activate the virtual environment: - On Windows:
venv\Scripts\activate 
- On macOS/Linux:
source venv/bin/activate
 
- On Windows:
- 
Install required dependencies: pip install -r requirements.txt 
- 
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 
 
- To install Chromium:
- 
Start testing: - Run the script (Check π§ Command line arguments for better setup):
python api_solver.py 
 
- Run the script (Check π§ Command line arguments for better setup):
| Parameter | Default | Type | Description | 
|---|---|---|---|
| --headless | False | boolean | Runs the browser in headless mode. Requires the --useragentargument to be set. | 
| --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 | 1 | integer | Sets the number of browser threads to use in multi-threaded mode. | 
| --host | 127.0.0.1 | string | Specifies the IP address the API solver runs on. | 
| --port | 5000 | integer | Sets the port the API solver listens on. | 
| --proxy | False | boolean | Select a random proxy from proxies.txt for solving captchas | 
To start the container, use:
- Change the TZ environment variable and ports to the correct one for yourself:
docker run -d -p 3389:3389 -p 5000:5000 -e TZ=Asia/Baku --name turnstile_solver theyka/turnstile_solver:latest- Use an RDP client (like Windows Remote Desktop, Remmina, or FreeRDP)
- Connect to localhost:3389
- Login with the default user:
- Username: root
- Password: root
 
- After this, you can start the solver by navigating to the Turnstile-Solverfolder.
  GET /turnstile?url=https://example.com&sitekey=0x4AAAAAAA| 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 | 
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?id=f0dbe75b-fa76-41ad-89aa-4d3a392040af| Parameter | Type | Description | Required | 
|---|---|---|---|
| id | string | The unique task ID returned from the /turnstilerequest. | Yes | 
If the CAPTCHA is solved successfully, the server will respond with the following information:
{
  "elapsed_time": 7.625,
  "value": "0.KBtT-r"
} 
Inspired by Turnaround Original code by Theyka Changes by Sexfrance