I’ve recently begun detangling myself from big tech. Gone is Google, Apple is going to take some time but I will get there. Follow along for updates on how I achieve this (home NAS with services for media and photos, device backups etc - and yeah, I know RAID isn’t a backup 😆).
This past week I have removed the DRM (Digital Rights Management) from my Kindle eBooks and Audible. The former is fairly straightforward, but the clock is ticking until Amazon remove the ability to download your purchases (without which, you won’t be able to remove the DRM).
What follows is a guide for informational purposes only. Use at your own risk.
Instructions
There are a few steps for removing the DRM from your Audible purchases. The first task is to obtain the unique to you DRM hex value from any of your purchases (note that if you have multiple accounts, then you’ll need to repeat it for each account). Once you have this, a free utility ffmpeg
can be used to complete the removal of DRM on each file in a fairly painless way (I wrote a simple command script to facilitate this which I will share below.
Step 1 – Download any Audible book
Log in to your account in your browser, go to your Library and download any title you wish (you will eventually need to download all the titles).
Step 2 – Install ffmpeg
onto your computer
Windows users, you can find pre-compiled versions at https://ffmpeg.org/download.html. For Linux and macOS users you can use the following command:
sudo apt-get install ffmpeg
WIndows users can use WSL, Linux and macOS can you your Terminal to execute the following command to obtain the tools necescary to obtain your Hex value:
git clone https://github.com/inAudible-NG/tables
Then cd
(change directory) into inAudible-NG
and then tables
.
Step 4 – Use fprobe
to obtain the checksum
Copy your downloaded book into the tables
folder.
From your command line enter the following command (replacing your-filename
with the full filename and extension (.aax)):
ffprobe your-filename 2>&1 | grep checksum
This will output some text, copy the lengthy checksum value without trailing or leading space. We will need this only once for the next step.
Step 5 – Get your unique DRM Hex value
Now that we have your checksum value we can use another tool we have downloaded to extract the DRM Hex value in your chosen file. Remember that this value is unique to you and is the same for all your Audible purchases. Therefore, we only need to do this step once 😁
Enter this command replacing checksum
with the value you copied in the step above:
./rcrack . -h checksum
In the output locate your Hex code at the bottom and keep it safe - you will need this for the final (repeated) step.
Step 6 – Clean up
We are now finished with the folder we downloaded. If you moved, instead of copying, your file into tables
go ahead and move it to somewhere else. Now would be a good time to create a new folder to store all your Audible files in.
With that done, go ahead and delete inAudible-NG
.
Step 7 – Remove the DRM from your files
Well done! Everything above was only necessary once! The next command needs to be executed for each of your files.
Create a new folder on your Desktop named noDRM
.
From the command line navigate to the location of all your DRM files.
for file in /path-to-DRM-folder/*; do base_name=$(basename "${file}" .aax); ffmpeg -activation_bytes hexCode -i "$file" -c copy /path-to-the-noDRM-folder/${base_name}.m4b; done
Now edit the text above in your command line setting path-to-DRM-folder
with the full path to your DRM folder, with a /
at the start and the end. Then do the same for path-to-the-noDRM-folder
. Finally, replace hexCode
with the one you obtained in step 5.
And you are done!
By all means open the noDRM folder and watch as the files are added there as .m4b
files (VLC Player and many other apps can open this file format). If you need to do this again for any new purchases from Audible, you need only place the purchased file in the DRM folder and run the above command (remember to remove any processed files first or it’ll run through them all again).