Metadata-Version: 2.4
Name: cloudsneak
Version: 1.0.0
Summary: Cloudflare clearance cookie and Turnstile token solver service
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn[standard]>=0.20.0
Requires-Dist: playwright>=1.35.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: py-ghost-cursor>=0.1.1
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: httpx; extra == "dev"

# cloudsneak

Cloudflare clearance cookie (`cf_clearance`) and Turnstile token solver service ported to Python.

## Features

- **Turnstile Token Solver**: Render and solve Cloudflare Turnstile challenge widgets using synthetic injection and local script replacement.
- **IUAM clearance cookie Extraction**: Intercept responses to extract `cf_clearance` cookies and corresponding `User-Agent`.
- **Anti-Detect Browser Integration**: Custom Chrome launch configurations with Playwright.
- **FastAPI REST API**: Server with TTL caching, authentication token checks, and concurrency throttling.

## Installation

```bash
pip install .
```

Ensure Playwright browsers are installed:

```bash
playwright install chromium
```

## Running the Server

Start the REST service:

```bash
cloudsneak --host 0.0.0.0 --port 8742
```

Or via python:

```bash
python -m cloudsneak.cli
```

## API Usage

### `POST /cloudflare`

#### Turnstile Mode

```json
{
  "mode": "turnstile",
  "domain": "https://example.com",
  "siteKey": "0x4AAAAAAACk534..."
}
```

#### IUAM Mode

```json
{
  "mode": "iuam",
  "domain": "https://example.com"
}
```
