Home

Awesome

<h1 align="center">m4b-merge</h1> <div align="center">

Status GitHub Issues GitHub Pull Requests License PyPI PyPI - Python Version Python package CodeFactor Grade PyPI - Downloads

</div>
<p align="center"> A CLI tool which outputs consistently sorted, tagged, single m4b files regardless of the input. <br> </p>

📝 Table of Contents

🧐 About <a name = "about"></a>

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:

Metadata provided by audnexus:

🏁 Getting Started <a name = "getting_started"></a>

Prerequisites

You can either install this project via pip directly or run it prepackaged in Docker:

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 /path/to/input:/input -v /path/to/output:/output ghcr.io/djdembeck/m4b-merge:main

You may also specify the user and group to run as with env variables:

-e UID=99 -e GID=100

🔧 Running the tests <a name = "tests"></a>

🎈 Usage <a name="usage"></a>

Workflow

The process is simple

  1. Pass the file as input via -i FILE.ext or folder -i DIR/
  2. Enter the ASIN (found on audible.com) when prompted.
  3. Depending on necessary conversions, the process will take between 5 seconds and 5-10 minutes.

CLI usage

usage: m4b-merge [-h] [--api_url API_URL] [--completed_directory COMPLETED_DIRECTORY] -i INPUTS [INPUTS ...] [--log_level LOG_LEVEL]
                 [--num_cpus NUM_CPUS] [-o OUTPUT]

m4bmerge cli

optional arguments:
  -h, --help            show this help message and exit
  --api_url API_URL     Audnexus mirror to use
  --completed_directory COMPLETED_DIRECTORY
                        Directory path to move original input files to
  -i INPUTS [INPUTS ...], --inputs INPUTS [INPUTS ...]
                        Input paths to process
  --log_level LOG_LEVEL
                        Set logging level
  --num_cpus NUM_CPUS   Number of CPUs to use
  -o OUTPUT, --output OUTPUT
                        Output directory
  -p PATH_FORMAT, --path_format PATH_FORMAT
                        Structure of output path/naming.Supported terms: author, narrator, series_name, series_position, subtitle, title, year

When installed via pip, you can run inputs like so

m4b-merge -i /path/to/file.mp3

Or for multiple inputs

m4b-merge -i /path/to/file.mp3 /dir/ /path/to/other/file

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 <a name = "built_using"></a>

✍️ Authors <a name = "authors"></a>

🎉 Acknowledgements <a name = "acknowledgement"></a>