AnimePahe downloader with automatic Cloudflare bypass via Playwright
Project description
AnimePahe Downloader
Downloads anime from animepahe.com.
Uses a real Chromium browser via Playwright to automatically solve Cloudflare's JS challenge — no manual cookie juggling needed.
Why Playwright?
AnimePahe uses Cloudflare's "Managed Challenge" (interactive JS mode) on every route including the JSON API.
Standard HTTP clients (requests, httpx, curl_cffi) cannot execute JavaScript and therefore always get a 403.
Playwright runs a real Chromium instance that solves the challenge exactly as a human browser would.
Installation
pip install animepahe-dl-tmux
# Required one-time setup — installs the Chromium browser (~150 MB):
playwright install chromium
If you skip
playwright install chromiumyou will get a "Browser not found" error.
Usage
animepahe-dl-tmux # interactive — prompts for everything
animepahe-dl-tmux "Demon Slayer" # search immediately, 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" --visible # show the browser window (debug)
How It Works
- Playwright launches a headless Chromium browser and visits
animepahe.com. - Cloudflare's JS challenge runs inside the real browser — it solves automatically (~5–15 s).
- The solved session cookies (
cf_clearanceetc.) are extracted and reused in fasthttpxAPI calls. - For each episode, the script navigates to kwik.si in the browser and intercepts the HLS
.m3u8URL from network traffic. - ffmpeg downloads and muxes the HLS stream into a single
.mp4file.
Output
Files are saved to downloads/<Anime Title>/Episode_NNNN.mp4 in the current directory.
Troubleshooting
| Symptom | Fix |
|---|---|
Browser not found |
Run playwright install chromium |
CloudflareError: Timed out |
Run with --visible to watch the browser; may need a manual CAPTCHA click |
ffmpeg: command not found |
Install ffmpeg: winget install ffmpeg (Windows) or brew install ffmpeg (Mac) or apt install ffmpeg (Linux) |
| No players found for an episode | The episode may not be available yet on AnimePahe |
Requirements
- Python 3.9+
- ffmpeg (in system PATH)
- Chromium browser: install with
playwright install chromium(~150 MB, one-time)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file animepahe_dl_tmux-1.4.1.tar.gz.
File metadata
- Download URL: animepahe_dl_tmux-1.4.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8729fff3fc5ecc26efcc2ca76782debdc4e1f93a5ebefeb14cb6bfe8791608e
|
|
| MD5 |
4ac58c3de1d14983eee6bb9e8e5ef2d3
|
|
| BLAKE2b-256 |
b88726daff6e94dec37cc1bd7320feedf4d0962a8fe7ca1f77f56bd58db93e0e
|
File details
Details for the file animepahe_dl_tmux-1.4.1-py3-none-any.whl.
File metadata
- Download URL: animepahe_dl_tmux-1.4.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3102224c2c130d9c2b2bd3db116b43dd90e31b5877a8121a941d9c9505c75d8
|
|
| MD5 |
4eda0893b735deb1a694a6fd51d6ca18
|
|
| BLAKE2b-256 |
9939048f58d5da56d4b6463cfd7f99bd78b1ebc589070311eb5bdba434fe494a
|