m4b-extractor

Crates.iom4b-extractor
lib.rsm4b-extractor
version0.0.2
created_at2025-07-06 06:35:14.341954+00
updated_at2025-07-06 06:40:43.720397+00
descriptionCLI tool to extract chapters, metadata and cover for M4B Audiobook.
homepagehttps://github.com/ewilan-riviere/m4b-extractor
repositoryhttps://github.com/ewilan-riviere/m4b-extractor
max_upload_size
id1739861
size7,304,256
Ewilan Rivière (ewilan-riviere)

documentation

README

m4b-extractor

rust tests

Rust CLI tool to extract chapters, metadata and cover for M4B Audiobook. . Based on idea of Hasan Arous.

Requirements

  • Rust
  • FFmpeg installed and available in your PATH

Installation

You can install m4b-extractor with Cargo.

cargo install m4b-extractor

Usage

You have to pass the path to the .m4b file you want to extract chapters from.

m4b-extractor /path/to/input.m4b

You will get a directory named <input_file>_chapters containing:

  • Each chapter as a separate .mp3 file.
  • A metadata.json file with the metadata of the book.
  • A tags.yaml file with the tags of the book.
  • A folder.jpg file with the cover of the book.
1_Chapter 01.mp3
2_Chapter 02.mp3
3_Chapter 03.mp3
# ...
folder.jpg
metadata.json
tags.yaml

Options

m4b-extractor --help
  • -o, --output <OUTPUT>: Specify the output directory for extracted chapters (default: <input_file>_chapters).
  • -k, --keep: Keep the original .m4b files without converting them to .mp3.
  • -q, --quality <QUALITY>: Specify the conversion quality (1=best, 9=worst) for .mp3 files (default: 2).
  • -s, --sanitize: Sanitize filenames by replacing invalid characters with underscores (default: false).
  • -h, --help: Print help information.
  • -V, --version: Print the version of the tool.

Build and publish

Build and test the package:

cargo test
cargo build --release

Test publishing:

cargo publish --dry-run

Publish the package to crates.io:

cargo publish

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 0

cargo fmt