Skip to content

About

Browser userscript that downloads, descrambles and archives books from BookWalker, CMOA, ebookjapan, Kindle, k-manga and DMMブックス, with optional mokuro OCR and upload through mokuro-bridge.

Topics

Resources

Contributing

Stars

17 stars

Watchers

1 watching

Forks

Repository files navigation

The dokuha-userscript banner: 読破 in orange brushstrokes inside a purple circle over a blurred shelf of manga covers, with DOKUHA (userscript) underneath.

読破 (dokuha-userscript) · v3.1.0

Archive the volume you already have open, at full resolution.

MIT · Tampermonkey or Violentmonkey

Quick start · Install · Screenshots · Why people use it · Supported stores · How it works · Related tools · Documentation

dokuha-userscript is a browser userscript that saves the volume you already have open in BookWalker, CMOA, ebookjapan, the Kindle web manga reader, k-manga or DMMブックス. It reads the viewer's own signed CDN URLs, fetches every page file directly, rebuilds each page offline, and gives you a ZIP or a finished Mokuro volume. You never turn a page to capture it.

The name comes from the Japanese word 読破, to read a work through to the end, which is what the script lets you do with a book you can already read online: offline, at full resolution, in your own reader.

Quick start

  1. Install a userscript manager: Tampermonkey (Chrome, Firefox, Edge) or Violentmonkey.
  2. Install the script (see Install), then open a volume in any supported reader. The panel appears once the viewer is ready.
  3. Choose Save as ZIP for a plain archive, or Save and run through Mokuro if a local mokuro-bridge is running, then watch both bars finish.

Install

Open dokuha-userscript.user.js and click Install, or install it from GreasyFork. Install one script only: the combined build and a single-store build match the same hosts, so running both gives you two panels.

Only need one store? Each store also has its own smaller userscript, carrying the shared core and that one store's code, so it can never pull in another store's protocol. The three older entries are on GreasyFork: BookWalker Native Downloader, CMOA Native Downloader and ebookjapan Native Downloader. Kindle, k-manga and DMMブックス install from this repository: Kindle Native Downloader, k-manga Native Downloader and DMMブックス Native Downloader.

Tampermonkey asks for cross-origin access to the stats and store-search hosts. That permission powers only the reading-stat cards and the "also available on" pills; decline it and downloading, OCR and ZIP saving work exactly the same.

Screenshots

The dokuha-userscript panel over a BookWalker viewer after a finished run: 172 pages saved as a ZIP in 5.8 seconds, the Mokuro bridge status and destination, reading stats and store links.
BookWalker: a finished run, 172 pages saved as a ZIP in 5.8 seconds, with the bridge and the reading stats in the panel.
The dokuha-userscript panel on ebookjapan, sending a volume to Google Drive.
ebookjapan: the same panel with a Google Drive destination.
The dokuha-userscript panel on CMOA, with the also-available-on store links.
CMOA: the also-available-on links for every shop that carries the series.
The dokuha-userscript panel on the k-manga viewer with a 46 page volume in flight: fetch and descramble at 29 of 46 pages, with the bridge OCR and an upload in progress.
k-manga: a 46 page volume in flight, with fetch, descramble, bridge and upload progress.
The dokuha-userscript panel on the Kindle web manga reader with a 225 page fixed layout volume in flight, 79 pages fetched and descrambled so far.
Kindle: a 225 page fixed layout volume mid-run, still fetching.
The dokuha-userscript panel on the DMMブックス viewer after a finished free volume: 201 pages saved as a ZIP in 7.3 seconds, the page size and free edition in Book Details, and the also-available-on card with BookWalker, ebookjapan, Kindle and DMMブックス itself.
DMMブックス: a finished 201 page free volume, with the six-shop availability card and the reading-stat card.

Why people use it

  • Full resolution, not screenshots. The CDN page file is fetched and rebuilt offline, so the output is the page as published rather than a picture of the page as displayed. JPEG at q0.92 is the default, and WebP, lossless and PNG are also available.
  • One panel, every supported store. The same controls and output work on BookWalker, CMOA, ebookjapan, Kindle, k-manga and DMMブックス, and the combined script picks the store from the page you are on.
  • Every shop checked at once. The "also available on" card asks each supported storefront whether it carries the series and shows the ones that do, with that volume's price, free count and product-page link, so you can see where the rest of a run lives before you commit.
  • Only on reader pages. The scripts match the viewers and nowhere else, so series, title, product and search pages never load the panel, the bridge probe or the traffic capture.
  • Resume, not restart. Pages are cached as they arrive; an interrupted run continues where it stopped, and the retry only fetches what is missing.
  • Fast on a normal browser profile. Fetches are spread across every origin a page can open, and rebuilds run across a worker pool, so a browser's six-connections-per-origin limit is not the ceiling.
  • A local mokuro-bridge is a download accelerator too. A browser gives six connections per origin, so each of the bridge's 48 default ports is six more sockets, up to 288 extra lanes against the 12 the script's own two lanes give it in the hermetic lane test. The gain is largest where a store serves one file per page and smaller on Kindle, which hands pages over in render windows. Run the bridge locally even when you never want OCR or cloud delivery, since the extra fetch lanes are the practical reason and the OCR button comes with the same install.
  • A panel that stays out of the way. Draggable, resizable and minimisable, it remembers where you put it and does not claim the arrow keys, so the viewer still turns pages normally.
  • Reading stats before you commit. Natively levels, ratings and reader counts, plus Manga Kotoba vocabulary totals, appear in the panel while you decide.

Supported stores

Store Viewer What the script reads Session
BookWalker viewer.bookwalker.jp signed CDN auth and the page manifest, from the viewer's own traffic Only for paid or library titles
CMOA cmoa.jp reader page list and BinB descramble geometry None
ebookjapan ebookjapan.yahoo.co.jp/viewer/ the viewer's page endpoints and shuffle geometry None
Kindle read.amazon.co.jp/manga/ render windows and the karamel token Always
k-manga comic.k-manga.jp/viewer/ the session from the viewer URL and page data over the viewer socket None
DMMブックス book.dmm.com free_streaming/ / tachiyomi/ viewer auth, the CloudFront-signed manifest and a 64×64 tile unshuffle None for free volumes and 試し読み samplers

DMMブックス currently covers the free full volumes and 試し読み samplers; paid and library volumes are not implemented, and its search is Japan-region only.

Each store's protocol record sits beside its code in src/sites/<store>/README.md, and docs/architecture.md explains how the shared pipeline uses it.

How it works

The script separates what is shared from what a store actually does differently. A store module knows how to read its viewer, how to ask for pages, and how to rebuild one page offline. Everything around that is shared core: the panel, the progress bars, the page cache, the archive writer, the transport lanes, the OCR hand-off and the automation API.

A run moves through five stages:

  1. Capture the viewer's own state. BookWalker's signed URLs are captured passively from its traffic; the other stores read their viewer's state or embedded data.
  2. Plan the page list, so the page count and order are known before a single CDN request.
  3. Fetch every page at full resolution, across the page itself, the userscript manager's background context, a dotted host and an HTTP/2 mirror, with retry ladders for expiring signatures and throttling.
  4. Rebuild each page offline. Depending on the store that means decrypting an envelope, unshuffling tiles on a canvas, running the viewer's own wasm, or decrypting a page cipher.
  5. Deliver the pages as a flat ZIP of page-0001.jpg and so on, or stream them to a running mokuro-bridge while capture is still going.

The full design, including the build model, the lane budget, the page cache and the bridge protocol, is in docs/architecture.md.

Related tools

Both are optional: this userscript works without either of them.

  • dokuha-cli is the sister tool in the same dokuha family: a batch downloader for the same stores that runs in Node with no browser. Reach for it when you want a whole series rather than the volume you have open, or when there is no browser session to capture.
  • mokuro-bridge is the one companion worth installing even for downloads alone: it is a separate service in the mokuro ecosystem, not part of the dokuha tools, and its local ports are what give this script the extra fetch lanes described above. It also runs mokuro OCR on finished pages and delivers the .cbz, .mokuro, cover .webp and per-series series.json that reader.mokuro.app reads, to a local folder, MEGA, Google Drive, OneDrive, WebDAV or whichever other destination the bridge is configured for. It interoperates with mokuro-bunko, which compiles its own library metadata.

Documentation

Document Answers
docs/architecture.md how the artifact is built, how a run flows, where the shared code ends and store code begins
src/README.md the source layout, the adapter contract, the fragment map and how to add a store
src/sites/bookwalker/README.md, cmoa, ebookjapan, kindle, kmanga, dmm each store's protocol record, next to its code
RELEASING.md the version, the tag, the release branch and the GreasyFork sync
CONTRIBUTING.md the two rules, the build invariant and how the suite is run
tests/README.md the hermetic suite, file by file
tests/acceptance/README.md the opt-in live-store run and its oracle
docs/greasyfork/ the paste-ready listing descriptions for the GreasyFork entries
CHANGELOG.md what changed, version by version

Development

npm install
npm run build        # assemble every artifact from src/
npm run check:build  # fail when a committed artifact no longer matches src/
npm test             # the hermetic suite, 37 of the 38 test files

The shipped .user.js files are built, never edited by hand: each is the concatenation of the src/ fragments in manifest order, so a change to the source is what changes the script. The suite runs the artifacts in headless Chrome against local stub servers, plus artifact and protocol checks that need no browser. npm run test:acceptance runs the opt-in live-store comparison and npm run test:bridge measures the fetch lanes against a throwaway bridge instance.

Credits and licence

Built by GolyBidoof with DeepSeek V4.1 Flash, an AI coding agent. The agent reverse engineered the stores' protocols, ported the crypto and descramble logic, and iterated against live captures until every step matched.

"BookWalker", "CMOA", "ebookjapan", "Kindle", "k-manga" and "DMMブックス" are trademarks of their respective owners. This project is not affiliated with or endorsed by any of them.

For personal, lawful use: download only content you are entitled to access, such as purchased books, free samples and trial chapters. Respect the services' terms of service and the rights of authors and publishers. The maintainer assumes no liability for misuse.

MIT. See LICENSE.

About

Browser userscript that downloads, descrambles and archives books from BookWalker, CMOA, ebookjapan, Kindle, k-manga and DMMブックス, with optional mokuro OCR and upload through mokuro-bridge.

Topics

Resources

Contributing

Stars

17 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages