Audiobookshelf - Autoconverter .m4b
A Docker to automatically convert all your current and future Audiobooks within Audiobookshelf to the single file .m4b format.
Your need (of cause) a running instance of Audiobookshelf for this Docker to work with!
(It can run on a different host than audiobookshelf if necessary)
I had a huge library of Audiobooks. Some of them were already .m4b but most of them were multiple mp3's.
I wanted to archive 3 things:
- Convert all my mp3 only Audiobooks to .m4b but a maximum of X in parallel (to not stress the server CPU too much).
- Automatic convert of newly added Audiobooks if they are not single file .m4b and let it check in cron style within a container.
- Don't use 3rd party software and use the built in converter of Audiobookshelf instead. So the API of Audiobookshelf was the way to go.
https://hub.docker.com/r/cutzenfriend/abs-autoconverter
- Get all items from the specified library. Filtered so that only multifile Audiobooks get returned
- Start the .m4b converting process for the specified amount of Audiobooks via API
- Wait and repeat until no more Audiobooks to convert are available
- Look every (hour) for new multifile books
The easiest way is to use the docker-compose.yml in this repository.
Before running the container please adapt the mandatory environment variables within the docker-compose.yml:
version: '3.3'
services:
abs-autoconverter:
image: cutzenfriend/abs-autoconverter:latest
container_name: abs-autoconverter
restart: unless-stopped
environment:
TZ: "Europe/Berlin"
DOMAIN: "https://abs.example.com" #Please edit - mandatory
LIBRARY_ID: "YOUR AUDIOBOOKSHELF LIBRARY ID" #Please edit - mandatory
MAX_PARALLEL_CONVERSIONS: 3 #Keep CPU power in mind. Too many conversion in parallel decrease performance on your host!
#CRON_SETTING: #optional - default is: (20 * * * * ) - every hour at minute 20
BITRATE: "128k" #optional - default is: 128k
TOKEN: "YOUR AUDIOBOOKSHELF API TOKEN" #Please edit - mandatory
Built with the latest node container as base and 2 further node modules.