Audiobook library archiver
Find a file
2024-11-03 09:40:07 +00:00
.gitignore fix: ignore local environment file 2024-10-21 08:22:39 +01:00
.mise.toml fix: better detection of files for each step 2024-11-03 09:22:51 +00:00
justfile fix: fix aax{c} detection 2024-11-03 09:40:07 +00:00
README.md fix: better detection of files for each step 2024-11-03 09:22:51 +00:00

A justfile containing recipes to help download, convert, rename, file and archive your audiobook collection.

The use of these recipes in intended for the sole purpose of maintaining a PERSONAL archive, and the resulting .m4b files should not be redistributed where doing so would violate your contract with the supplier of the original .aax and .aaxc files.

Requirements

Mise will be used to install the other dependencies. If you don't want to use mise, then you need to install the following:

Transitive Dependencies

For refile-m4b you will also need these libraries (or the equivalent for your OS):

  • libtag1-dev
  • libtagc0-dev

Debian

sudo apt install libtag1-dev libtagc0-dev

Install mise

curl https://mise.run | sh
~/.local/bin/mise --version

Install dependencies with mise

mise install

This will use the .mise.toml file to install all the required dependencies.

Note on Installing audible-cli Manually

If you aren't using mise to install the audible-cli then note that the latest version (v0.3.1) doesn't work (at least for me), so I recommend using the latest version in the master branch.

Usage

Check prerequisites

Run the doctor recipe to verify prerequisites:

just doctor

e.g.:

Verify required executables are on the path:
-   OKAY  : audible => ~/.local/share/mise/installs/pipx-mkb79-audible-cli/master/bin/audible
-   OKAY  : just => ~/.local/share/mise/installs/just/latest/bin/just
-   OKAY  : fzf => ~/.local/share/mise/installs/go-github-com-junegunn-fzf/latest/bin/fzf
-   OKAY  : jq => ~/.local/share/mise/installs/jq/latest/bin/jq
-   OKAY  : ffmpeg => ~/.local/share/mise/installs/ffmpeg/latest/bin/ffmpeg
-   OKAY  : refile-m4b => ~/.local/share/mise/installs/cargo-refile-m4b/latest/bin/refile-m4b

Authenticate & Register

When prompted to name your profile, use the default: 'audible'. We use that name to locate the file ~/.audible/audible.json when converting AAX files.

audible quickstart
audible activation-bytes

This will log in to you account, register a pseudo device in your account and store the details in ~/.audible/.

Fetch Library

Once you have bought a title or otherwise added to your account's library, you need to fetch a copy of the latest library list.

just fetch-library

This will create a new file library-{date}.txt, that contains a list of everything available in your account.

Select, download and convert

The recommended workflow is to run the default recipe which will present you with a searchable list of your library. From here you can select items to download by pressing TAB (for selecting mutliple titles), or ENTER to select just the one.

just

Once you have made your selection, the .aax and/or .aaxc/.voucher files will be downloaded, via a ./TEMP/ directory, before being moved to either the ./AAX/ or ./AAXC/ directories.

Once downloaded they will be automatically converted to DRM free .m4b files in the ./M4B/ directory.

NOTE: After being converted the source files in the ./AAX/ and ./AAXC/ directories are deleted.

The files in ./M4B/ will then be refiled, by refile-m4b, into directories based on the author, series and title.

Review

You are now free to rename and/or move the files to more closely fit your own prefered archival needs.

Archive

Once you are happy you can run the 'archive' recipe to move the files into your archive.

export AUDIOBOOK_ARCHIVE=/mnt/external/audio-books/
just archive

Set the AUDIOBOOK_ARCHIVE environment variable to the directory where you want your .m4b files to be stored.

NOTE: Once the files have been copied, the files in the M4B directory are deleted.