drductus/audible-processor
A docker image that lets you convert Audible AAX files into chapterized MP3s
524
Audible Processor is a docker container to help you create and manage a personal backup of your audible library. It will convert your AAX files into DRM-free mp3 files broken into chapters. The container can be used to run a daemon to watch a folder and convert any files found/create in it into mp3s, or to convert a single AAX.
By default, it will read the meta data from the AAX file and nest the MP3s in folders as such: "<out_dir>///mp3s".
v1.0.0 of this container used https://audible-converter.ml/ to look up the activation bytes to decrypt the DRM. However, they recently added reCaptcha to their API so that it can no longer be used by bots (my bad, sorry!). As such, in v2.0.0 and up the watcher will pause until we locate the activation bytes ourselves. See the Authentication section below for more instructions.
Volumes for default command:
A simple watcher that will convert one book at a time as they are found
docker run -v "${PWD}/aax:/aax" -v "${PWD}/mp3:/mp3" drductus/audible-processor
A watcher that will convert three books at a time from a subfolder of the mounted volume
docker run -v "${PWD}/audible:/audible" drductus/audible-processor watch -t 3 -o /audible/mp3 /audible/aax
Environment variables can be used for most of the command line arguments so that they're easier to updated with managed deploys.
-o/--out => OUTPUT_DIR
--author-dir => USE_AUTHOR_DIR
--title-dir => USE_TITLE_DIR
-b/--activation-bytes => ACTIVATION_BYTES
-t/--threads => THREADS
-i/--interval => INTERVAL
-v/--verbose => VERBOSITY
Advanced watcher options
docker run drductus/audible-processor watch --help
The service now requires that we locate the activation bytes ourselves. We can do this in 3 ways.
Use a service like https://audible-converter.ml/ to determine the activation bytes for a single aax file, then pass those directly to the service using the -b
argument for the watcher or the processor.
Your new docker command would look something like this:
docker run -v "${PWD}/aax:/aax" -v "${PWD}/mp3:/mp3" drductus/audible-processor watch -b <activationBytes> -o /mp3 /aax
You can use the following linux command to extract the Checksum from a file: dd bs=1 skip=653 count=20 if=/path/to/aax/file | od -vt x1 -A n
. This will output hex pairs that you can type in to site above instead of uploading a whole file.
Use a service like in step 1, but instead of using the -b
command, we can save the bytes to a file that the service can referenced. In your /mp3
volume folder, run the following command: echo '<bytes>' > .auth
. The service will now find this file and use its contents moving forward.
auth
command on a running containerThe new auth command will log in to Audible using your credentials and retrieve the activation bytes directly. It will then cache them for the service to use.
Once the watcher is running, use the following command to start the authentication process, replacing /mp3
with the output path your watcher is using:
docker exec -it <containerId> auth -o /mp3
Copy the very long URL that is output into the console and paste it into a browser. In the browser, log in to your audible account. You will probably need to log in twice, the second time with a captcha. You will be redirected to a "Sorry" page. Copy that URL from your browser, and paste it back into the console window running the docker command and hit enter.
This should create the file /mp3/.auth
that will contain your activation bytes. The service will now be able to use those and move forward with decrypting everything.
If you don't want to run the watcher, you will still need to make sure the service knows the proper activation bytes. Steps 1 and 2 above will work without complication. Step 3 will need some minor modifications to use run
instead of exec
. Use the following command then follow the remained of the instructions for Step 3.
docker run --rm -it -v "${PWD}/audible:/audible" drductus/audible-processor auth -o /audible/mp3
This will properly create the .auth file in your destination output folder, where the service will be able to see it.
Convert a list of files in audible/axx into mp3s
docker run --rm -v "${PWD}/audible:/audible" drductus/audible-processor process -o /audible/mp3 /audible/aax/*.aax
Override the author and book title directories when converting an AAX file
docker run --rm -v "${PWD}/audible:/audible" drductus/audible-processor process -a 'Dan Wells' -t 'Mr. Monster' -o /audible/mp3 '/audible/aax/mr monster book 2.aax'
Advanced watcher options
docker run --rm drductus/audible-processor process --help
Now that we have to run multiple commands for the authentication, I don't like that the only way to determine the output folder is by using a command line argument. As such, I'm planning on adding this additional functionality in the future:
auth
handling directly from the processor for one-time executions.docker pull drductus/audible-processor