@kentcdodds/audible
Personal Audible library app — browser re-auth, library, wishlist, NAS archive stub.
README.md
86 lines · 4.6 KB · Markdown@kentcdodds/audible
Intent
Give Kent / Patch a fork-ready Kody package (and phone-first package app) that
talks to Audible’s unofficial API so owned titles can be inventoried and archived
to the household NAS — without needing OpenAudible or audible-cli on the
machine for day-to-day re-auth. Success means: open the app → Amazon OpenID+PKCE
login → paste the maplanding URL → ADP signing auth is stored in package
storage (audible-auth-v1); then browse library/wishlist and tap Save to NAS.
This package archives owned titles only. It handles the Audible API (Adrm
AAXC license + content URL). Home MCP converts to a flat Title.m4b and writes
/media/audiobooks.
Share this package as https://kody.codes/@kentcdodds/audible
What it does
- Phone-first package app: Connect, Library, Wishlist, Archive
- Browser Amazon OpenID + PKCE + virtual device registration (TypeScript port of mkb79/Audible login/register — no AGPL Python vendored)
- ADP sign-request auth in pure TypeScript / WebCrypto
- Auto-refresh access tokens from
refresh_tokenwhen present - Import OpenAudible / audible-cli JSON still supported via
fromAuthFile - List / search library with On NAS markers + infinite scroll, wishlist add/remove, Adrm AAXC license, Save-to-NAS / bulk remaining via home MCP
- Auth readiness without leaking secrets (
./auth-status)
Connect (human playbook)
- Open the hosted package app (publish response
hosted_app_url, or Open app on the package page) → Connect tab. - Pick locale (default US) → Connect Audible → finish Amazon login (CAPTCHA / 2FA stay in Amazon’s UI). You may need credentials twice.
- Amazon lands on
…/ap/maplanding?…&openid.oa2.authorization_code=…(404/error page is expected). - Paste that full URL into the app → Finish connect.
- The package registers a virtual Audible device, builds audible-cli-compatible
auth JSON, and saves it in package storage (
audible-auth-v1) for ADP signing. OptionalsecretSetasaudibleAuthis best-effort for host naming only — after opaque secrets, mounts are placeholders and cannot beJSON.parsed for signing. - Re-auth once after the opaque-secrets platform change (or whenever the
virtual device is invalidated / storage is cleared). Access tokens still
refresh automatically from
refresh_tokenonce Connect has run.
Agent / export equivalent:
kody:@kentcdodds/audible/start-auth→{ locale? }→{ loginUrl, authSessionId }kody:@kentcdodds/audible/complete-auth→{ redirectUrl, authSessionId? }→{ ok, authStatus }(never returns secret values)
Pastes into /account/secrets/new alone are not enough for ADP signing
anymore (opaque secret values). Prefer the Connect flow so keys land in package
storage. Host allowlists for api.audible.* / api.amazon.* still matter for
outbound calls.
App tabs
| Tab | What you get |
|---|---|
| Connect | Locale picker, Amazon login, paste maplanding URL, auth chip |
| Library | Searchable owned titles with infinite scroll, On NAS vs Save to NAS / Re-save, quiet Plus · stream only / Not an audiobook download badges, All / Not on NAS / On NAS chips, reload / pull-to-refresh |
| Wishlist | List + add/remove by ASIN (infinite scroll when paginated) |
| Archive | Save all remaining (N) bulk archive (confirm + progress + stop) plus per-title Save to NAS → home MCP Title.m4b (Plus / Shows skipped; already-on-NAS skipped; Replace if it already exists / Library Re-save to overwrite) |
Done when
- Browser connect (or imported auth) leaves
./auth-statuswithsigningReady: true - App Library lists owned titles without printing tokens
- Wishlist mutations work
- Library /
./library-archive-statusmarks titles already on the NAS (Title.m4b) - Archive /
./archive-to-nassaves (or skips) a title on the NAS via home MCP - Archive tab /
./archive-remainingcounts and can archive all downloadable titles not yet on the NAS - Re-auth is rare thanks to refresh_token
Branding
Official Audible orange soundmark paths from the Simple Icons
Audible entry (#F8991C). Audible® is a trademark of Amazon.com, Inc. or its
affiliates. This package is not affiliated with or endorsed by Amazon or Audible.
Docs
- Authorization (external browser)
- Authentication
- mkb79/Audible (reference only — not vendored)