Audible has a great selection of audiobooks that can be downloaded and listened to on the go. However, there is one big caviat: All audiobooks have DRM on them and can only be listened to using the official audible app.
Wan’t to listen to the audiobook using your car’s stereo? Good luck. Wan’t to preserve the audiobook because you want to listen to it in 10 years time? Nope. Wan’t to use an android device without google play services or (heaven forbid) are looking forward to the linux smartphones landing in 2019? Amazon is laughing at you.
Luckily, things are not as dire as my last paragraph would lead you to believe. If you have googled a bit you will most certainly have seen this blogpost on code-bude.net which outlines how to convert aax file to mp3. Since 2017 however things have gotten easier:
- The selenium based <code>audible-activator</code> tool has been preceeded by an offline tool / rcrack preset called <code>inAudible-NG/tables</code> which should be more reliable (I could not get audible-activator to work).
- No other tool is needed:
ffmpegsupports audible conversion out of the box.
What do we need?
To go forward we need to install 2 pieces of software:
- <code>inAudible-NG/tables</code> can be cloned for 1-time usage
ffmpegis probably already installed on your system
inAudible-NG/tables will provide us with a activation hash that is needed to decrypt the files.
This hash is unique per account - meaning you only need to generate it once for all of your audiobooks.
ffmpeg will convert the files from the propriatary .aax format to whatever you like.
I recommend using opus (for best compression) or mp3 (for best support).
Getting the activation bytes
To extract the ‘activation bytes’ we first need a file hash of an aax file:
$ ffprobe audiobook.aax [...] [aax] file checksum == 27ae5bf7df0bab8401776657d90dca85XXXXXXXX [aax] activation_bytes option is missing! [...]
This hash is then passed to rcrack (from
$ ./rcrack . -h 27ae5b47df0bab6401776657d90dca85XXXXXXXX [...] result ---------------------------------------------------------------- 27ae5b47df0bab6401776657d90dca85XXXXXXXX [...] hex:c345eXXX
Converting the file
Converting the file can be done with all of the usual ffmpeg options with an additional
-activation_bytes option containing the hex hash from above.
$ ffmpeg \ -i audiobook.aax \ -activation_bytes c345eXXX \ freedom.mp3
- All steps shown here are meant for file preservation. If you want to listen to quality audiobooks then buy, don’t pirate.
- The hashes and activation bytes in the examples above are obviously anonymized.