Skip to content

fix: reject Audible's DRM .aa/.aax releases in ranking - #518

Closed
NichCodes wants to merge 2 commits into
kikootwo:mainfrom
NichCodes:fix/reject-drm-releases
Closed

NichCodes wants to merge 2 commits into
kikootwo:mainfrom
NichCodes:fix/reject-drm-releases

Conversation

@NichCodes

@NichCodes NichCodes commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Automatic search can currently grab Audible .aa/.aax releases, but nothing in a typical RMAB setup can play them. This drops DRM releases in the ranking pre-filter, next to the 20 MB floor, so they're never grabbed or listed.

Why reject them instead of importing them

  • The requester can't unlock them. An AAX file is encrypted for the Audible account that bought it. A torrent copy was bought by the uploader, so even someone with their own activation bytes can't decrypt it.
  • RMAB can't decrypt them. DRM decoding is out of scope (documentation/phase3/file-organization.md): chapter merging excludes .aa/.aax, and Plex format coercion logs "DRM, Plex cannot import" and skips them.
  • Media servers can't play them. Audiobookshelf leaves aa/aax out of its supported audio types (SupportedAudioTypes in server/utils/globals.js, checked on v2.37.2), so the book shows up with nothing to play. Plex can't import them either.
  • The request looks like it succeeded. .aa/.aax are in AUDIO_EXTENSIONS, so the download and import go through as normal. The requester only finds out when playback fails, and there's no automatic retry.
  • It wastes download and seeding. A private-tracker grab of a file nobody can play still costs bandwidth and a seeding commitment.
  • Rejecting them can't fail a request. If only DRM releases match, the request goes to awaiting_search and is retried later, like any request with no usable results. Interactive search still lists every other release.

Behavior

  • aax matches as a whole word anywhere in the title: .aax, [AAX], Dune AAX.
  • aa only matches as a .aa extension or an [AA]/(AA) tag. A bare "AA" is usually an author's initials ("AA Milne"), so it doesn't count.
  • It runs in the shared pre-filter, so it applies to both automatic and interactive search.

Test Case Change

tests/utils/ranking-match-gates.test.ts (#459) included Frank Herbert - Dune AAX in the "right books still clear the threshold" list, where it checks that a format word doesn't break title matching. With this change that release is rejected before scoring, so I moved the case into the DRM tests in tests/utils/ranking-algorithm.test.ts, which now expect it rejected. Every other format-word case in that list is unchanged.

If you'd still rather keep AAX releases eligible, I can turn this into a score penalty instead, so one is only chosen when nothing else matches.

Testing

  • New tests in tests/utils/ranking-algorithm.test.ts:
    • [AAX], a bare AAX, [AA], a dotted .aax and a dotted .aa are rejected.
    • "Isaac and the Aardvark" and "AA Milne" are kept.
  • Full suite passes: 6451 passed, 68 skipped, 0 failed (Node 24, as in CI).
  • docker compose build succeeds.
  • Docs: documentation/phase3/ranking-algorithm.md (pre-filter list).

Audible .aa/.aax files can't be decrypted without the requester's own
activation bytes, so a release in that format is unplayable in any media
server. Drop them in the pre-scoring filter, next to the 20 MB floor, so
automatic search never grabs one and interactive search doesn't list them.

`aax` matches as a whole token anywhere in the title. A bare `aa` is a
common author initialism ("AA Milne"), so it only counts as a `.aa`
extension or a bracketed `[AA]`/`(AA)` tag.

"Frank Herbert - Dune AAX" was a must-accept case in the match-gates
tests (kikootwo#459). It moves to the DRM tests, which now expect it rejected.
An AAX file is encrypted for the Audible account that bought it, so a
torrent copy is locked to the uploader's account and the requester's own
activation bytes can't unlock it either. The comments and docs said the
opposite. Also note that Audiobookshelf doesn't treat .aa/.aax as audio.
@NichCodes NichCodes changed the title [Fix] Reject Audible's DRM .aa/.aax releases in ranking fix: Reject Audible's DRM .aa/.aax releases in ranking Nov 2, 2026
@NichCodes NichCodes changed the title fix: Reject Audible's DRM .aa/.aax releases in ranking fix: reject Audible's DRM .aa/.aax releases in ranking Nov 2, 2026
@kikootwo

kikootwo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

@NichCodes thanks for this. I'm bringing it in as #528 with you as co-author, narrowed a bit: only the automatic search skips these releases (Interactive Search still lists them), and only when the title marks the file itself as DRM, with a .aa, .aax or .aaxc extension or a tag like [AAX]. Converted releases such as [M4B] (from AAX) are still grabbed. I also added .aaxc. I'll close this one when it lands.

kikootwo added a commit that referenced this pull request Nov 2, 2026
…528)

Automatic search skips a release whose title marks it as an Audible DRM file: a .aa, .aax or .aaxc extension ending a word, or a bracketed tag holding only the format ([AAX], (AA), {AAXC}), unless the title also names a playable format (m4b, mp3, m4a, flac, opus, ogg). A bare AAX word is kept, since converted releases name their source that way. Each skipped release is logged once; interactive search still lists them. DRM_EXTENSIONS gains .aaxc.

Based on #518 by @NichCodes, narrowed to automatic grabs and to titles that mark the file itself as DRM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: NichCodes <90598280+NichCodes@users.noreply.github.com>
@kikootwo

kikootwo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

@NichCodes thanks again. It's in now as #528 with you as co-author, as described above. It will be in the next release. Closing this one in favour of #528.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants