Package: m4b-merge
m4b-mergeA CLI tool which outputs consistently sorted, tagged, single m4b files regardless of the input.📝 Table of ContentsAboutGetting StartedUsageBuilt UsingContributingAuthorsAcknowledgments🧐 Aboutm4b-merge was originally part ofBragi 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 intodonefolder ininputdirectory.Metadata provided byaudnexus: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 andchapters.txt.High resolution (2000x2000 or greater) cover art - embedded into output file.🏁 Getting StartedPrerequisitesYou can either install this project viapipdirectly or run it prepackaged in Docker:If installing directly on your system, you'll need to install m4b-tool and it's dependants fromthe project's readmeIf using Docker, all prerequisites are included in the image.InstallingFor apipinstallationSimply runpip install m4b-mergeFor a Docker installationYou'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:mainYou may also specify the user and group to run as with env variables:-e UID=99 -e GID=100🔧 Running the testsRunpip install pytestTo run all tests, runpytestfrom inside this project directory.To run a single test, runpytest tests/test_NAME.py🎈 UsageWorkflowThe process is simplePass the file as input via-i FILE.extor folder-i DIR/Enter the ASIN (found on audible.com) when prompted.Depending on necessary conversions, the process will take between 5 seconds and 5-10 minutes.CLI usageusage: 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, yearWhen installed viapip, you can run inputs like som4b-merge -i /path/to/file.mp3Or for multiple inputsm4b-merge -i /path/to/file.mp3 /dir/ /path/to/other/fileOn Docker, you can run inputs like sodocker run -it merge m4b-merge -i /input/file.mp3For a folder of multiple audio files, simply pass the folder itself as an input, such as-i /input/dir⛏️ Built Usingaudnexus- API backend for metadatam4b-tool- File merging and tagging✍️ Authors@djdembeck- Idea & Initial work🎉 Acknowledgementssandreasfor creating and maintainingm4b-tool