Commit e065edb5dd6e

Vincent Demeester <vincent@sbr.pm>
2026-01-02 08:53:11
feat(audible-converter): Add AAXC format support
- Enable conversion of newer Audible books using AAXC encryption - Preserve full compatibility with existing AAX workflow - Document voucher-based decryption for user troubleshooting Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 0c87ca6
Changed files (2)
pkgs
audible-converter
pkgs/audible-converter/convert.sh
@@ -164,7 +164,7 @@ download_book() {
 		--output-dir "$TEMP_DIR"
 }
 
-# Convert AAX files to M4B
+# Convert AAX/AAXC files to M4B
 # Usage: convert_books [directory|file]
 convert_books() {
 	local source_path="${1:-$TEMP_DIR}"
@@ -172,17 +172,17 @@ convert_books() {
 
 	# Determine if we're converting a directory or a single file
 	if [ -d "$source_path" ]; then
-		# Find all AAX files in directory using find
-		log_info "Searching for AAX files in: $source_path"
-		mapfile -t aax_files < <(find "$source_path" -maxdepth 1 -type f -name "*.aax" -o -name "*.AAX")
+		# Find all AAX and AAXC files in directory
+		log_info "Searching for AAX/AAXC files in: $source_path"
+		mapfile -t aax_files < <(find "$source_path" -maxdepth 1 -type f \( -name "*.aax" -o -name "*.AAX" -o -name "*.aaxc" -o -name "*.AAXC" \))
 
 		if [ ${#aax_files[@]} -eq 0 ]; then
-			log_warn "No AAX files found in $source_path"
+			log_warn "No AAX/AAXC files found in $source_path"
 			return 0
 		fi
-		log_info "Found ${#aax_files[@]} AAX file(s)"
+		log_info "Found ${#aax_files[@]} AAX/AAXC file(s)"
 	elif [ -f "$source_path" ]; then
-		# Single file
+		# Single file (both AAX and AAXC supported)
 		aax_files=("$source_path")
 	else
 		log_error "Invalid path: $source_path"
@@ -190,7 +190,7 @@ convert_books() {
 	fi
 
 	local total_files=${#aax_files[@]}
-	log_info "Converting $total_files AAX file(s) to $FORMAT format..."
+	log_info "Converting $total_files AAX/AAXC file(s) to $FORMAT format..."
 
 	# Get authcode (either provided or from audible-cli)
 	local authcode="$AUTHCODE"
pkgs/audible-converter/README.md
@@ -7,18 +7,20 @@ Download and convert Audible audiobooks to Audiobookshelf-compatible formats.
 `audible-converter` is a wrapper tool that combines [audible-cli](https://github.com/mkb79/audible-cli) and [aaxtomp3](https://github.com/KrumpetPirate/AAXtoMP3) to:
 
 - Download audiobooks from your Audible library
-- Convert AAX files to M4B/MP3/M4A formats
+- Convert AAX and AAXC files to M4B/MP3/M4A formats
 - Preserve chapter markers and metadata
 - Organize output for Audiobookshelf
 
 ## Features
 
 - **Download from Audible**: Sync your entire library or download specific books
+- **AAX & AAXC format support**: Converts both AAX (older) and AAXC (newer) formats
 - **Multiple output formats**: M4B (recommended), MP3, or M4A
 - **Chapter preservation**: Maintains chapter markers and navigation
 - **Metadata embedding**: Preserves title, author, narrator, cover art
 - **Batch processing**: Handle multiple books at once
 - **Quality options**: Choose between best, high, or normal audio quality
+- **Automatic voucher handling**: AAXC files are decrypted using voucher files downloaded alongside
 
 ## Installation
 
@@ -215,19 +217,60 @@ audible-converter convert file.aax
 
 ### Download Failures
 
-Some books may fail to download (already purchased, region restrictions):
+Some books may fail to download for various reasons:
 
-- The tool will warn about failed downloads and continue
+**Non-downloadable books**: Some items in your Audible library cannot be downloaded:
+- Podcasts (excluded via `--ignore-podcasts` flag)
+- Plus Catalog books that have been removed
+- Region-restricted content
+- Books returned or removed from your library
+- Special content types (guided meditations, sleep sounds, etc.)
+
+The tool will skip these automatically and continue processing. Example error:
+```
+error: The Manager's Path is not downloadable.
+```
+
+**Other download issues**:
 - Check the ASIN is correct: `audible library list`
 - Verify the book is in your library for your region
+- Check network connectivity
+
+### AAXC Format Support
+
+**AAXC files (newer Audible format) are fully supported** by aaxtomp3!
+
+**How it works:**
+- AAXC is a newer encryption format introduced by Audible
+- When downloading with `--aaxc` flag, audible-cli downloads both the `.aaxc` file and a `.voucher` file
+- The voucher file contains the decryption key and IV (initialization vector)
+- `aaxtomp3` reads the voucher file and uses the key/IV to decrypt the AAXC file
+- Conversion proceeds normally after decryption
+
+**Download strategy:**
+- The script uses `--aax-fallback` flag: tries AAX first, falls back to AAXC if AAX is unavailable
+- Older books: typically available as AAX
+- Newer books: may only be available as AAXC
+- Both formats convert successfully ✓
+
+**Requirements:**
+- Voucher file must be present alongside the AAXC file
+- Naming convention: `bookname.aaxc` and `bookname.voucher`
+- audible-cli downloads both automatically when using `--aaxc` or `--aax-fallback`
 
 ### Conversion Issues
 
-If AAX conversion fails:
-
+**For AAX files:**
 1. Ensure you have the required dependencies (included in the package)
-2. Check the AAX file is not corrupted
-3. Try downloading the book again
+2. Verify activation bytes are available: `audible activation-bytes`
+3. Check the AAX file is not corrupted
+4. Try downloading the book again
+
+**For AAXC files:**
+1. Ensure the `.voucher` file exists alongside the `.aaxc` file
+2. Check voucher file contains valid JSON with `key` and `iv` fields
+3. Verify the voucher file was downloaded at the same time as the AAXC file
+4. If voucher is missing, re-download the book with `--aaxc` flag
 
 ### Permission Errors