Skip to main content

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 chromium you 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

  1. Playwright launches a headless Chromium browser and visits animepahe.com.
  2. Cloudflare's JS challenge runs inside the real browser — it solves automatically (~5–15 s).
  3. The solved session cookies (cf_clearance etc.) are extracted and reused in fast httpx API calls.
  4. For each episode, the script navigates to kwik.si in the browser and intercepts the HLS .m3u8 URL from network traffic.
  5. ffmpeg downloads and muxes the HLS stream into a single .mp4 file.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

animepahe_dl_tmux-1.4.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

animepahe_dl_tmux-1.4.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

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

Hashes for animepahe_dl_tmux-1.4.1.tar.gz
Algorithm Hash digest
SHA256 c8729fff3fc5ecc26efcc2ca76782debdc4e1f93a5ebefeb14cb6bfe8791608e
MD5 4ac58c3de1d14983eee6bb9e8e5ef2d3
BLAKE2b-256 b88726daff6e94dec37cc1bd7320feedf4d0962a8fe7ca1f77f56bd58db93e0e

See more details on using hashes here.

File details

Details for the file animepahe_dl_tmux-1.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for animepahe_dl_tmux-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3102224c2c130d9c2b2bd3db116b43dd90e31b5877a8121a941d9c9505c75d8
MD5 4eda0893b735deb1a694a6fd51d6ca18
BLAKE2b-256 9939048f58d5da56d4b6463cfd7f99bd78b1ebc589070311eb5bdba434fe494a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page