Contact us
Leave a message

Please use:

My public cryptographic key

Member of

Free your audio books!

A well-known, big online vendor of audio books doesn't offer its titles in the well-known and widely supported form of mp3 files, but in a proprietary, DRM protected format called aax. I was not too pleases when I learned that the audio books I purchased from them were unplayable on both Linux and my good, old mp3 player running Rockbox.

Of course, I wasn't the first to struggle with this completely unnecessary bullying, and after some research I finally MacGyvered the following python script in order to facilitate both transferring audio books to a DRM-free format and splitting the recording into nice, little mp3 files.


Here's the output of the built-in help, accessible through --help:

usage: [-h] [-x] [-c AUTHCODE] [-a AUTHOR] [-b BOOK] [-s SERIES]
                 [-T TRACK_TEMPLATE] [-p PERFORMER] [-y YEAR]
                 [-o OUTDIR_TEMPLATE] [-n FILENAME_TEMPLATE] [-f {mp3}]
                 [-t TRIM_INTRO] [-u TRIM_EXTRO] [-w PAD_WITH_SILENCE]
                 [-m COVER_IMAGE]

Convert aax audiobooks to collections of audio files.

positional arguments:

optional arguments:
  -h, --help            show this help message and exit
  -x, --extract-metadata
                        Only extract metadata.
  -c AUTHCODE, --authcode AUTHCODE
                        Authorization code.
  -a AUTHOR, --author AUTHOR
                        Author name.
  -b BOOK, --book BOOK  Book title.
  -s SERIES, --series SERIES
                        Series name.
  -i INSTALMENT, --instalment INSTALMENT
                        Instalment number within series.
                        Artist tag template. ["{author}"]
                        Album tag template. ["{series} {instalment} - {book}
                        for series, "{book}" else]
                        Track tag template. ["{album}
  -p PERFORMER, --performer PERFORMER
                        Performer tag content.
  -y YEAR, --year YEAR  Year.
                        Output directory template.
                        ["out/{author}/{series}/{instalment} - {book}" for
                        series, "out/{author}/{album}" else]
                        Track filename template. ["{formatted_chapter_number}
                        - {book} {chapter_number}"]
  -f {mp3}, --format {mp3}
                        Output format. ["mp3"]
  -t TRIM_INTRO, --trim-intro TRIM_INTRO
                        After removing Trim start of first track by specified
                        number of seconds. Try 1.5 for English and 3.5 for
                        German audio books.
  -u TRIM_EXTRO, --trim-extro TRIM_EXTRO
                        Trim end of last track by specified number of seconds.
                        Try 2.5 for both English and German audio books.
  -w PAD_WITH_SILENCE, --pad-with-silence PAD_WITH_SILENCE
                        After trimming, pad beginning of first chapter and end
                        of last chapter, respectively, with the specified
                        number of seconds of silence. [1.0]
  -m COVER_IMAGE, --cover-image COVER_IMAGE
                        Cover image filename. ["album.jpg"]

Requires ffmpeg to be installed and in path.

Unfortunately, I have to ask you to find out for yourself how to acquire the so-called "authcode" mentioned above...


You may download the tool from my corresponding GitLab repository.