A manga reader for manhuagui.com with two modes:
- Web viewer — fullscreen two-page spread, iPad support, PWA
- TUI reader — terminal reader using the Kitty graphics protocol (Ghostty / kitty)
pip install flask playwright requests pillow
playwright install chromiumpython3 viewer.py
# or open a specific chapter directly:
python3 viewer.py https://m.manhuagui.com/comic/46693/669911.htmlOpen http://localhost:8080 in your browser or http://<local-ip>:8080 on iPad (same WiFi).
Controls:
| Action | Keyboard | Touch |
|---|---|---|
| Next page | Space / → |
Swipe right |
| Prev page | ← |
Swipe left |
| Jump to page | G |
Tap the page counter |
| Toggle UI | F |
Double-tap |
| Toggle spread | S or click ⊞ button |
— |
| Shift spread pairing | X or click ⇄ button |
— |
iPad: Add to Home Screen for true fullscreen (PWA).
Requires a terminal with the Kitty graphics protocol — Ghostty or kitty.
python3 tui.py https://m.manhuagui.com/comic/46693/669911.htmlControls:
| Action | Key |
|---|---|
| Next page | Space / → / l |
| Prev page | ← / h |
| Toggle spread | s |
| Jump to page | g |
| Chapter list | c |
| Quit | q |
In the chapter list (c): d / x downloads the highlighted chapter, a downloads
every chapter. Run python3 tui.py with no URL to browse downloaded comics offline.
Chapters can be saved to disk for offline reading. Images go into a human-readable folder tree:
~/Manga/<book>/<chapter>/001.webp, 002.webp, …, meta.json
Set the MANGA_DIR environment variable to change the location. Downloads are
resumable — already-saved pages are skipped on a re-run.
Downloaded-first: opening any chapter — by URL or via prev/next — checks the library first. If it has been downloaded, it loads straight from disk (instant, no scraping, works with no internet); otherwise it falls back to scraping the site online. So you don't need the Library list to get the offline copy — a downloaded chapter just opens offline by its normal URL.
Web viewer: open the chapter panel (☰ Chapters) — click ⬇ next to any chapter
to save it, or ⬇ Download all chapters. ⬇ Save in the top bar saves the chapter
you're reading. Live progress shows as a percentage on the chapter row itself
(47% → ✓); already-saved chapters carry a persistent ✓. Downloaded comics
also appear on the landing page, click one to read it offline.
When reading a downloaded chapter, 🌐 View online in the top bar reloads the live online version for that page (downloaded-first stays the default for prev/next).
TUI: in the chapter list, d / x saves a chapter and a saves all. Launch
python3 tui.py with no URL to pick from the offline library.
Both modes share a disk cache at ~/.cache/manga-viewer/. Images are fetched once and served locally on repeat visits. This is separate from the ~/Manga/ download library above.