bun-readlater-epub takes a URL from a Safari bookmarklet, extracts the article and writes a self-contained EPUB in a dedicated Calibre library. OPDS clients such as KOReader handle delivery and reading, which keeps the service focused on capture and conversion.
It is designed for one user on a trusted network. Authentication is a shared token and the queue is intentionally serial.
The Bun HTTP service records each submission in SQLite and passes it to a serial queue. The fetch stage normalises and deduplicates URLs, applies timeout and size limits, extracts readable HTML and can fall back to an archived copy.
Images are fetched, resized, converted to greyscale e-ink modes and embedded locally. The EPUB packager and Calibre metadata.db writer use Bun and standard-library primitives rather than external EPUB or Calibre management libraries. The result appears in a dedicated library for downstream OPDS clients.
A Safari bookmarklet uses a plain form submit for compatibility and returns a small acknowledgement page after saving.
Browser-like requests, timeouts, retries, content-type checks, size limits, canonical URL deduplication and tracking-parameter removal.
Readable article HTML and locally embedded images are packaged directly into self-contained EPUB files.
Adaptive greyscale processing includes gray8 and gray4-dither output modes.
Creates the Calibre-compatible library hierarchy and updates metadata.db without invoking Calibre.
The web UI shows queue status, item detail, attempt history, and retry or refetch controls.