m4b-merge
A CLI tool which outputs consistently sorted, tagged, single m4b files regardless of the input.
📝 Table of Contents
🧐 About
m4b-merge was originally part of Bragi Books, but was split apart to allow savvy users to automate its usage in more advanced ways. Some of the things m4b-merge offers are:
- Accepts single and multiple mp3, m4a and m4b files.
- mp3s are converted to m4b. m4a/m4b files are edited/merged without conversion.
- Matches existing bitrate and samplerate for target file conversions.
- Final files moved to
/output/Author/Book/Book: Subtitle.m4bformat. - Moves finished files into
donefolder ininputdirectory.
Metadata provided by audnexus:
- Title, authors, narrators, description, series, genres, release year - written as tags.
- Chapter times/titles (only when input is m4b or a single mp3) - written as tags and
chapters.txt. - High resolution (2000x2000 or greater) cover art - embedded into output file.
🏁 Getting Started
Prerequisites
You can either install this project via pip directly or run it prepackaged in Docker:
- If installing directly on your system, you'll need to install m4b-tool and it's dependants from the project's readme
- If using Docker, all prerequisites are included in the image.
Installing
For a pip installation
Simply run
pip install m4b-merge
For a Docker installation
You'll need to specify input/output volumes in the run command for easy use later:
docker run --name=merge -v /input:/path/to/input -v /output:/path/to/output ghcr.io/djdembeck/m4b-merge:main
🔧 Running the tests
- Run
pip install pytest - To run all tests, run
pytestfrom inside this project directory. - To run a single test, run
pytest tests/test_NAME.py
🎈 Usage
Workflow
The process is simple
- Pass the file as input via
-i FILE.ext - Enter the ASIN (found from audible.com) when prompted.
- Depending on necessary conversions, the process will take between 5 seconds and 5-10 minutes.
CLI usage
usage: m4b-merge [-h] -i INPUTS [INPUTS ...] [--log_level LOG_LEVEL]
m4b-merge cli
optional arguments:
-h, --help show this help message and exit
-i INPUTS [INPUTS ...], --inputs INPUTS [INPUTS ...]
Input paths to process
--log_level LOG_LEVEL
Set logging level
When installed via pip, you can run inputs like so
m4b-merge -i /path/to/file.mp3
On Docker, you can run inputs like so
docker run -it merge m4b-merge -i /input/file.mp3
For a folder of multiple audio files, simply pass the folder itself as an input, such as -i /input/dir
⛏️ Built Using
✍️ Authors
- @djdembeck - Idea & Initial work
🎉 Acknowledgements
Metadata
Release files for m4b-merge 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| m4b-merge-0.4.2.tar.gz | 25.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| m4b_merge-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.1 kB
Release files / m4b-merge-0.4.2.tar.gz
| Download URL | m4b-merge-0.4.2.tar.gz |
|---|---|
| Size | 25.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
953dd766fae9553b887bde601a97026fc192612118884a180f9a688037328a36
|
|
BLAKE2b-256 checksum How to use checksums |
f71c530aa66a91f8397867c15f8b9c5cc6f86b84f9c9ea20bd7304905ade07eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / m4b_merge-0.4.2-py3-none-any.whl
| Download URL | m4b_merge-0.4.2-py3-none-any.whl |
|---|---|
| Size | 24.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00edb9c708fe4512cb42a289d2215c47da95f8c5529c8b1f2487125ff7a6c409
|
|
BLAKE2b-256 checksum How to use checksums |
a4d7fe0efe78b0cf11cfb3331d09ada91e64d0688a563c1666d616e3ab67cf38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|