audiobook-curator
audiobook-curator is a reusable Claude Code and Codex plugin for turning audiobook sources into verified single-file M4Bs without sacrificing the originals. It packages the operational workflow and a portable CLI; it contains no personal media, credentials, run history, media-server integration, or machine-specific paths.
The governing idea is simple: discovery is not identity, identity is not integrity, and a successful conversion is not a verified result. Each gate gets its own JSON receipt.
What it covers
- recursive source inventory with ffprobe facts
- whole-library summaries for missing metadata, artwork, long-file chapters, probe failures, duplicate candidates, and multipart groups
- deterministic quality selection from probed codec, bit depth, sample rate, and bitrate; material duration conflicts are flagged for review
- natural source order and one chapter per selected input
- dry-run conversion plans;
--apply is required to create media
- single M4B output while retaining all source files
- filesystem-safe output names with apostrophes removed, while embedded metadata retains correct punctuation
- Audible multi-region candidate search, scoring, response caching, artwork, and chapter metadata
- explicit human-reviewed Audible candidate selection receipts with language, narrator, runtime, and abridgement evidence
- bounded/retrying downloads (
curl has connect timeout, total timeout, and retry limits)
- optional Audiolocate sample-to-local acoustic verification, including multi-candidate identification over an
audible-search report
- optional whisper.cpp transcription at five distributed positions, with additional bounded windows until three usable excerpts are found or the configured cap is exhausted
- generic reviewed chapter application, including Audible chapter payloads, using stream-copy and verified atomic replacement
- verified metadata updates that preserve existing cover art when no replacement is supplied
- optional Audiobook Forge
source-quality conversion engine
- automatic stream-copy for a single existing M4B instead of needless audio transcoding
- multipart
--audio-codec alac|aac selection: ALAC keeps the decoded source audio lossless at the original sample rate and channel layout; AAC uses a configurable bitrate (default 128k) while retaining the source sample rate and channels when supported
- dynamic
--jobs parallelism scaled to available CPU cores and runnable conversion work, with no hardcoded single-core behavior
- chapter title, order, positive-duration, continuity, first-boundary, and media-end validation
- optional source-to-output chapter title/order/boundary validation against the conversion receipt
- optional full decode plus file SHA-256, audio-stream SHA-256, and byte-size receipts
Safety model
inventory, library-audit, select, audible-search, audible-select, audible-cache, acoustic-verify, acoustic-identify, whisper-verify, and audit never alter source media. They may write only the report or cache path explicitly supplied.
convert, apply-metadata, and apply-chapters are dry runs unless --apply is present. Conversion never deletes or renames inputs. Metadata and chapter commands are intended only for a user-approved derived M4B; they create a same-directory temporary replacement and promote it only after audio hash, duration, chapters, tags, and artwork pass the applicable checks. Keep plans, applied receipts, and final audits together.
Dependencies
- Python 3.11+
- ffmpeg and ffprobe
- curl
- optional: Audiobook Forge 2.11 or newer for
convert --engine audiobook-forge
- optional:
audiolocate
- optional:
whisper-cli from whisper.cpp and a user-supplied ggml model
Bootstrap from a clone:
./scripts/bootstrap.sh
The script checks system executables, creates an isolated .venv, and installs the Python package there in editable mode. It does not alter the system Python, install ffmpeg, download models, or modify an AI client. bin/audiobook-curator automatically uses that environment.
CLI walkthrough
Inventory and select sources:
./bin/audiobook-curator library-audit ./audiobook-library --report receipts/library-audit.json
./bin/audiobook-curator inventory ./source-book --report receipts/inventory.json
./bin/audiobook-curator select \
--inventory receipts/inventory.json \
--report receipts/selection.json
Find and cache a reviewed identity candidate:
./bin/audiobook-curator audible-search \
--title "Gerald's Game" \
--author "Stephen King" \
--narrator "Example Narrator" \
--duration 11160 \
--regions us,uk \
--report receipts/audible-candidates.json
./bin/audiobook-curator audible-select \
--candidates receipts/audible-candidates.json \
--candidate 2 \
--receipt receipts/audible-selection.json