A command-line tool to convert audiobooks downloaded with LibreGrab into M4B audiobook format.
- MP3 to M4B Conversion: Concatenates multiple MP3 files into a single M4B audiobook file
- Automatic Chapter Detection: Parses LibreGrab metadata to preserve chapter markers
- Metadata Preservation: Extracts and embeds title, author, narrator, and description
- Fallback Metadata: Generates metadata from ID3 tags when LibreGrab metadata is unavailable
- Progress Reporting: Visual progress bar during conversion
- Configurable Output: Custom output directory support
- .NET 10.0 SDK or later
- FFmpeg installed and available in PATH
# Clone the repository
git clone https://github.com/clFaster/LibreToM4b.git
cd LibreToM4b
# Build the project
dotnet build
# Run the tool
dotnet run --project LibreToM4b -- convert <input-folder># Basic usage - converts audiobook to default output folder (Music/LibreToM4b)
LibreToM4b convert <input-folder>
# With custom output folder
LibreToM4b convert <input-folder> --output <output-folder>
LibreToM4b convert <input-folder> -o <output-folder>| Argument | Description |
|---|---|
input-folder |
Path to the folder containing MP3 files from LibreGrab |
| Option | Short | Description |
|---|---|---|
--output |
-o |
Output folder for the M4B file (default: Music/LibreToM4b) |
The input folder should contain:
audiobook-folder/
├── 001.mp3
├── 002.mp3
├── ...
└── metadata/
└── metadata.json (optional - LibreGrab metadata)
LibreToM4b/
├── LibreToM4b.Core/ # Core library with models and services
│ ├── Models/ # Data models (Book, Chapter, etc.)
│ ├── Services/ # Conversion service logic
│ └── Interfaces/ # Service abstractions
└── LibreToM4b/ # CLI application
└── Commands/ # Command-line command handlers
This project is licensed under the MIT License - see the LICENSE file for details.