Metadata-Version: 2.4
Name: animepahe-dl-tmux
Version: 1.4.4
Summary: AnimePahe downloader — automatic Cloudflare bypass via system Chrome (DrissionPage)
License: MIT
Keywords: anime,animepahe,cloudflare,downloader,nodriver
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: drissionpage>=4.1.0
Requires-Dist: rich>=13.7.0
Description-Content-Type: text/markdown

# AnimePahe Downloader

Downloads anime from **animepahe.com** with **automatic Cloudflare bypass** — no cookies to paste, no manual steps.

## How It Works

1. **First run**: opens your **system Chrome** browser for ~5–10 seconds to solve the Cloudflare challenge automatically
2. Saves the session cookies locally (`~/.cache/animepahe-dl-tmux/`)
3. All subsequent requests use **curl_cffi** (Chrome TLS fingerprint) with the cached cookies — no browser opened again
4. If cookies expire (~24 h), the browser re-opens automatically and refreshes them
5. kwik.si stream URLs are decoded by running the page's obfuscated JS through **Node.js**
6. **ffmpeg** downloads the HLS stream to MP4

## Requirements

- **Chrome or Chromium** installed on your system (used for the initial Cloudflare bypass)
- **Node.js** in PATH — for kwik.si stream decoding — https://nodejs.org
- **ffmpeg** in PATH — for HLS download — https://ffmpeg.org

## Installation

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

No other setup needed — just run it.

## 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 quality
animepahe-dl-tmux --clear-cache           # force a fresh browser session
```

## Output

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

## Troubleshooting

| Symptom | Fix |
|---|---|
| Chrome not opening / browser error | Make sure Chrome or Chromium is installed and in PATH |
| Cloudflare keeps looping | Run `animepahe-dl-tmux --clear-cache` then try again |
| `Node.js is required` | Install from https://nodejs.org |
| `ffmpeg not found` | `winget install ffmpeg` / `brew install ffmpeg` / `apt install ffmpeg` |
| No players found | Episode may not be on AnimePahe yet |
