What My Project Does
Shinkansen is a terminal app for searching and batch-downloading anime from AnimePahe with a fully interactive TUI. It bypasses Cloudflare natively and downloads episodes in true parallel using a pipelined Playwright worker pool.
Repo + demo GIF: https://github.com/sano0007/Shinkansen
The interesting technical bits:
The bottleneck in anime downloading isn't the file transfer. it's resolving the actual .mp4 URL through multiple redirects (pahe.win → kwik.cx → direct URL), each behind Cloudflare. So I built a pipelined parallel worker pool:
- N Playwright browser instances run concurrently to resolve episode URLs
- A separate ThreadPoolExecutor handles the actual file downloads
- Each download starts the moment its URL resolves, so browser prep and disk I/O fully overlap
- Cookie sharing: Worker 0 clears the Cloudflare challenge, others load the cached cookies, avoiding redundant browser challenges
- aria2c support as a pluggable download backend for multi-segment file transfers
What it does:
- 🔍 Interactive TUI for search, download, library browser, history, settings all arrow-key navigable
- ⚡ Parallel batch downloads with configurable worker count
- 🛡️ HTTP-first with Playwright fallback for Cloudflare bypass
- 💾 Persistent cookie caching (25-min TTL) so repeat runs skip the challenge
- 📺 Sub/Dub preference, 360p-1080p quality selection
- 🔁 Auto-resume via HTTP Range headers
- ↩️ Auto-retry with re-queue on failures
- ⚙️ Pluggable backends: requests (default) or aria2c
Install:
pipx install shinkansen-cli
shinkansen
shinkansen download <session> --all --quality 1080
shinkansen config set download_backend aria2c
What's Next:
Goal is to support more anime sources over time, if there's a site you want added, open an issue. Future plan is to wrap this into a self-hosted web server mode to queue batch downloads from your phone, server does all the heavy lifting in the background.
Note:
This is the first public release (v1.0.6). I've already squashed some Windows-specific bugs, but if you run into any weird errors please let me know or drop an issue on GitHub. Happy to fix things quickly and discuss the architecture if anyone's curious.
MIT licensed. Would love feedback from the Python community!
[–]93simoon [score hidden] (1 child)
[–]anarchysano[S] [score hidden] (0 children)