Metadata-Version: 2.4
Name: animepahe-dl-tmux
Version: 1.4.2
Summary: AnimePahe downloader — no browser required, cf_clearance cookie + curl_cffi
License: MIT
Keywords: anime,animepahe,curl_cffi,downloader
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.9
Requires-Dist: curl-cffi>=0.7.0
Requires-Dist: rich>=13.7.0
Description-Content-Type: text/markdown

# AnimePahe Downloader

Downloads anime from **animepahe.com** — no browser, no Playwright, no Docker.

## How It Works

1. You paste your `cf_clearance` cookie (from browser DevTools) once
2. All HTTP requests use **curl_cffi** (Chrome TLS fingerprint) + that cookie
3. kwik.si stream URLs are decoded by running the page's obfuscated JS through **Node.js**
4. **ffmpeg** downloads the HLS stream to MP4

## Installation

```bash
pip install animepahe-dl-tmux
```

**Requirements (must be in PATH):**
- `node` — Node.js (for kwik.si JS decoding) — https://nodejs.org
- `ffmpeg` — for HLS download — https://ffmpeg.org

## Setup (one-time)

1. Open **https://animepahe.com** in Chrome/Firefox
2. Wait for the page to fully load (Cloudflare clears automatically)
3. Press **F12** → **Application** tab → **Cookies** → **https://animepahe.com**
4. Copy the value of **`cf_clearance`**
5. Run:
   ```bash
   animepahe-dl-tmux --set-cookie YOUR_CF_CLEARANCE_VALUE
   ```

The cookie stays valid for **~24 hours**. Repeat step 5 when it expires.

## Usage

```bash
animepahe-dl-tmux                          # interactive — prompts for everything
animepahe-dl-tmux "Demon Slayer"           # search + pick episodes interactively
animepahe-dl-tmux "Demon Slayer" --all     # download every episode
animepahe-dl-tmux "Demon Slayer" -e 1-5   # episodes 1 through 5
animepahe-dl-tmux "Demon Slayer" -e 1,3,7 # specific episodes
animepahe-dl-tmux "Demon Slayer" -r 720   # prefer 720p
```

## Output

Files saved to `downloads/<Anime Title>/Episode_NNNN.mp4` in your current directory.

## Troubleshooting

| Symptom | Fix |
|---|---|
| `cf_clearance cookie is not set` | Run `animepahe-dl-tmux --set-cookie <value>` |
| `Got 403` or `Cookie expired` | Get a new cookie from browser DevTools and re-run `--set-cookie` |
| `Node.js is required` | Install Node.js from https://nodejs.org |
| `ffmpeg not found` | Install ffmpeg — `winget install ffmpeg` / `brew install ffmpeg` / `apt install ffmpeg` |
| No players found | The episode may not be available yet on AnimePahe |
