A command-line tool to interactively browse your Audible library, download audiobooks, decrypt them to the standard .m4b format, and clean up the intermediate files.
This script acts as a user-friendly wrapper around the powerful audible-cli and ffmpeg tools.
- Interactive Library Browsing: Navigate your entire Audible library in a clean, paginated table right in your terminal.
- Configurable Sorting: View your library with the newest or oldest books first.
- Direct Download: If you already know the book's ASIN, you can download it directly without browsing.
- Automatic Decryption: Converts the proprietary
.aaxcformat to a standard, DRM-free.m4baudiobook file. - Metadata Included: Chapters, cover art, and other metadata are preserved in the final file.
- Automatic Cleanup: All intermediate files (
.aaxc,.voucher,.jpg,.json) are deleted after a successful conversion, keeping your download directory clean. - External Configuration: Easy-to-edit
config.inifile for all user settings. - Profile Support: Works with named profiles from your
audible-clisetup.
Before you begin, you must have the following software installed and configured on your system.
-
Python 3.8+
- You can check your version with
python3 --version.
- You can check your version with
-
FFmpeg
- This is a critical dependency for decrypting and converting the audio files.
- On macOS (using Homebrew):
brew install ffmpeg
- On Debian/Ubuntu:
sudo apt update && sudo apt install ffmpeg - On Windows (using Chocolatey):
choco install ffmpeg
-
audible-cli
- This is the underlying tool used to communicate with Audible's servers.
- Install it via pip:
pip install audible-cli
-
Clone or Download:
- Download the files (
audible_downloader.py,config.ini.example,requirements.txt) from this repository and place them in a single directory.
- Download the files (
-
Install Python Dependencies:
- Navigate to the directory in your terminal and run:
pip install -r requirements.txt
- Navigate to the directory in your terminal and run:
-
Configure
audible-cli(Crucial Step):- You must authenticate
audible-cliwith your Audible account. Run the quickstart command and follow the on-screen instructions. It will likely open a browser for you to log in.audible quickstart
- If you have multiple Audible accounts, you can create named profiles. This script supports them via the
--profileflag.
- You must authenticate
-
Configure the Script:
- Make a copy of the example configuration file:
cp config.ini.example config.ini
- Open
config.iniin a text editor and customize the settings:output_dir: The default folder where your final.m4bfiles will be saved.page_size: How many books to show on each page in the library browser.default_sort: Set tonewest_firstoroldest_first.
- Make a copy of the example configuration file:
Make sure the script is executable (you only need to do this once):
chmod +x audible_downloader.pyTo start the interactive menu, simply run the script without any options:
./audible_downloader.pyYou will be presented with a choice to either browse your library or download a book directly by its ASIN.
- Library Browser Controls:
Enter a book #: Downloads the corresponding book.n: Go to the next page of results.p: Go to the previous page.q: Quit the library browser.
If you already know a book's ASIN, you can download it directly:
./audible_downloader.py --asin B002V5A12YUsage: audible_downloader.py [OPTIONS]
Options:
-a, --asin TEXT The ASIN of the book to download directly.
--profile TEXT The audible-cli profile to use.
-k, --keep-files Keep intermediate files after decryption.
--version Show the version and exit.
-h, --help Show this message and exit.
-
Error: "Could not get library data" or "command failed"
- This is almost always an authentication issue with
audible-cli. Your login token may have expired. - Solution: Run
audible quickstartagain to refresh your credentials.
- This is almost always an authentication issue with
-
"rich" or "click" module not found
- You haven't installed the Python dependencies.
- Solution: Run
pip install -r requirements.txt.
-
"ffmpeg: command not found"
- FFmpeg is not installed or is not in your system's PATH.
- Solution: Follow the installation instructions for FFmpeg in the Prerequisites section.
