Audible-Cli
A utility to bulk download Audiobooks from Audible
How to Install
-
Log into a Linux VM (Example is using a Debian VM and at least has to be on the Bookworm release)
-
Install Python 3 and pip, if needed
apt install python3 python3-pip
-
Install audible-cli
pip install audible-cli
-
Set up Audible
audible quickstart
-
Proceed through the wizard to login to Audible
How to Use
Activation Bytes
This will give you the activation bytes for your account, which you will need to decrypt your books
audible activation-bytes
Library Export
Export a list of all your audiobooks from audible to a CSV file
audible library export -f csv
Download your audiobooks
Download all your books
Note, this will also download any podcasts or similar, such as a NYT subscription
audible download --all --aax-fallback
Download a specific book
See the exported list for the book to ASIN number mapping (Can also be found in the web URL for a book)
audible download --aax-fallback -a {ASIN Number}
Remove DRM from Audiobooks
-
Install ffmpeg
apt install ffmpeg
-
Check the version, it must be at least version 4.5
ffmpeg -version
-
Create a folder to store decrypted books
mkdir drm-free
-
Remove DRM from all aax books in the current directory, storing them in the above directory
for i in *.aax; do ffmpeg -y -activation_bytes $(audible activation-bytes) -i "$i" -map_metadata 0 -id3v2_version 3 -codec:a copy -vn "./drm-free/${i%.*}.m4b"; done
-
AAXC files require a little more work to decrypt
-
Open the file that starts with the book name, and ends with “.voucher”
nano Book_Title-AAX_11_22.voucher
-
Make a note of the IV and Key (You may have to scroll down, it is under license_response)
-
Edit the following command, adding the IV, Key and AAXC file name
ffmpeg -y -audible_iv "IV Here" -audible_key "KEY here" -i "AAXC file name" -map_metadata 0 -id3v2_version 3 -codec:a copy -vn "./drm-free/Book name.m4b"
-
Wait for the file to finish decrypting
-
Organize the books into folders
-
Install a tool for examining file metadata
apt install exiftool
-
Move into the DRM free folder
cd drm-free
-
Run the following command to create artist and book folders from the m4b files, then move the books into them:
for b in *.m4b; do mkdir -p "$(exiftool $b -Artist -s -s -s)/$(exiftool $b -Title -s -s -s)"; mv $b ./"$(exiftool $b -Artist -s -s -s)/$(exiftool $b -Title -s -s -s)"; done