github juanra/audiobook-forge v2.2.0
v2.2.0: Audible Metadata Integration

latest releases: v2.9.1, v2.9.0, v2.8.2...
one month ago

🎧 Audible Metadata Integration

This release adds comprehensive Audible metadata integration, allowing automatic enrichment of audiobooks with professional metadata from Audible's catalog.

✨ New Features

Audible Metadata Features

  • New metadata command - Fetch and manage Audible metadata
    • metadata fetch - Query Audible by ASIN or title/author search
    • metadata enrich - Inject Audible metadata into existing M4B files
  • Build integration - Automatic metadata fetching during conversion
    • --fetch-audible - Enable Audible metadata enrichment
    • --audible-region <REGION> - Specify Audible region (us, uk, ca, au, fr, de, jp, it, in, es)
    • --audible-auto-match - Auto-match books by folder name
  • ASIN auto-detection - Automatically detects ASINs in folder names
    • Pattern: `Book Title [B00G3L6JMS]`
    • Supports multiple formats: brackets, dashes, standalone
  • 10 Regional stores - Full support for all Audible regions
    • US, CA, UK, AU, FR, DE, JP, IT, IN, ES
    • Region-specific catalog access

Metadata Extraction

  • Comprehensive fields extracted from Audible:
    • Core: title, subtitle, authors (with ASINs), narrators, publisher, year
    • Content: description, language, duration, abridged status
    • Organization: series (with sequence numbers), genres, tags
    • Identifiers: ASIN, ISBN
    • Media: cover URL, customer rating
  • Cover art download - High-resolution cover artwork
    • Automatic download and embedding
    • Replaces local covers with Audible artwork
    • Configurable via `metadata.audible.download_covers`

Caching & Performance

  • Filesystem caching - Intelligent metadata caching
    • Location: `~/.cache/audiobook-forge/audible/`
    • Default TTL: 7 days (configurable)
    • JSON format for easy debugging
    • Automatic cache expiry based on file modification time
  • Rate limiting - Respects Audnexus API limits
    • 100 requests per minute (token bucket algorithm)
    • Automatic wait when limit approached
    • Configurable via `metadata.audible.rate_limit_per_minute`

Configuration

New `metadata.audible` config section:
```yaml
metadata:
audible:
enabled: false # Auto-fetch during build
region: "us" # Default region
auto_match: false # Search by folder name
download_covers: true # Download cover art
cache_duration_hours: 168 # 7-day cache
rate_limit_per_minute: 100 # API rate limit
```

📖 Usage Examples

Fetch Metadata by ASIN

```bash
audiobook-forge metadata fetch --asin B00B5HZGUG --region us
```

Search by Title/Author

```bash
audiobook-forge metadata fetch \
--title "The Martian" \
--author "Andy Weir" \
--region us \
--output metadata.json
```

Enrich Existing M4B

```bash

With explicit ASIN

audiobook-forge metadata enrich --file book.m4b --asin B00B5HZGUG

Auto-detect ASIN from filename

audiobook-forge metadata enrich \
--file "The Martian [B00B5HZGUG].m4b" \
--auto-detect
```

Auto-Fetch During Build

```bash

With ASIN in folder names

audiobook-forge build \
--root /audiobooks \
--fetch-audible \
--audible-region us

Auto-match by folder name

audiobook-forge build \
--root /audiobooks \
--fetch-audible \
--audible-auto-match
```

🔧 Technical Details

New Dependencies

  • `reqwest` (0.11) - HTTP client for API calls
  • `governor` (0.6) - Token bucket rate limiting
  • `lazy_static` (1.4) - Regex compilation optimization

Files Added

  • `src/models/audible.rs` - Data structures for Audible metadata
  • `src/audio/audible.rs` - HTTP client and API integration (399 lines)
  • `src/utils/cache.rs` - Filesystem caching layer (219 lines)
  • `tests/audible_integration.rs` - Integration tests
  • `AUDIBLE_METADATA.md` - Comprehensive feature documentation (387 lines)

API Integration

  • Audnexus API - https://api.audnex.us
    • Public API (no authentication required)
    • Community-maintained wrapper around Audible
    • Endpoints:
      • `GET /books/{ASIN}?region={region}` - Fetch by ASIN
      • `GET /books?title={title}&author={author}` - Search

Code Statistics

  • ~1,500 lines of new code
  • 100% test coverage for core functionality
  • Zero compilation errors
  • Full async/await integration with existing Tokio runtime
  • All 81 tests passing

📚 Documentation

See AUDIBLE_METADATA.md for comprehensive documentation including:

  • Quick start guide
  • Configuration options
  • ASIN detection patterns
  • Regional support details
  • Troubleshooting guide
  • API reference

🚀 Migration Notes

Enable Audible Metadata

  1. Update to v2.2.0:
    ```bash
    cargo install audiobook-forge --force
    ```

  2. Initialize/update config:
    ```bash
    audiobook-forge config init --force
    ```

  3. Enable in config (optional):
    ```yaml
    metadata:
    audible:
    enabled: true
    region: "us"
    ```

  4. Use during build:
    ```bash
    audiobook-forge build --root /audiobooks --fetch-audible
    ```

ASIN Folder Naming

For automatic detection, rename folders to include ASINs:
```bash

Before

My Audiobook/

After (ASIN auto-detected)

My Audiobook [B00G3L6JMS]/

or

B00G3L6JMS - My Audiobook/
```

⚠️ Limitations

  • API rate limit: 100 requests per minute (Audnexus restriction)
  • Auto-match accuracy: May have false positives with common titles
  • Region-specific: Books must be available in selected Audible region
  • Network required: Metadata fetching requires internet connection

🔮 Future Enhancements

Potential improvements for future versions:

  • Interactive search result selection
  • Batch metadata updates for existing M4B libraries
  • Custom metadata field mapping
  • Integration with other metadata sources (MusicBrainz, GoodReads)
  • Metadata comparison and conflict resolution UI

Full Changelog: https://github.com/juanra/audiobook-forge/blob/main/CHANGELOG.md

Don't miss a new audiobook-forge release

NewReleases is sending notifications on new releases.