Audiobook-first automation for MyAnonamouse → qBittorrent → Audiobookshelf.
Quick Start • Configuration • How to Use • Troubleshooting • Docs
ShelfArr is an audiobook-first management app for searching MyAnonamouse (MAM), sending torrents to qBittorrent, and importing completed downloads into Audiobookshelf.
Originally forked from raygan/mam-audiofinder and intended to remain upgrade-compatible where practical.
- Features
- Quick Start
- Configuration
- How to Use
- Architecture Overview
- Troubleshooting
- Logs
- Technical Documentation
- Requirements
- License
- Vue 3 SPA: Search, History (imports + verification), Showcase, Logs, and Series.
- Search MAM: Find audiobooks by title/author/narrator with rich results.
- Add to qBittorrent: One-click torrent submissions with category support.
- Import to Audiobookshelf: Link/copy/move downloads, optional disc flattening, and verification.
- Series discovery: Explore series metadata via Hardcover.
git clone https://github.com/magrhino/shelfarr.git
cd shelfarr
cp env.example .envAt minimum, set your port, user/permissions, MAM + qBittorrent details, and host mount paths:
APP_PORT=8008
PUID=1000
PGID=1000
UMASK=0002
# --- MAM and qBittorrent credentials ---
MAM_COOKIE=mam_id=your_cookie_here
QB_URL=http://qbittorrent:8080
QB_USER=youruser
QB_PASS=yourpass
# Recommended
QB_CATEGORY=shelfarr
# --- host mounts (adjust to your system) ---
MEDIA_ROOT=/path/to/media
DATA_DIR=/path/to/appdata/shelfarr/dataTip: you can paste the full Cookie header, a mam_id=... cookie, or a single token; ShelfArr normalizes it.
docker-compose.yml references an external network named nginx-network. If you don’t use it, either create it:
docker network create nginx-network…or edit docker-compose.yml to remove the networks: section.
docker compose up -d --buildVisit http://127.0.0.1:8008 (or whatever you set in APP_PORT).
If you set ABS_BASE_URL, ShelfArr will prompt you to log in with your Audiobookshelf credentials to enable covers, library checks, and verification.
All configuration is done via environment variables (see env.example). Common ones are listed here.
| Variable | Description |
|---|---|
APP_PORT |
Host port to expose the web UI on (maps to container port 8080) |
PUID |
Host user ID to run the container as |
PGID |
Host group ID to run the container as |
UMASK |
File creation mask (octal string, e.g. 0002) |
MEDIA_ROOT |
Host path mounted to /media in the container (should include your downloads + library paths or hardlinks will not work) |
DATA_DIR |
Host path mounted to /data (databases, logs, cover cache) |
QB_URL |
qBittorrent WebUI URL |
QB_USER |
qBittorrent username |
QB_PASS |
qBittorrent password |
MAM_COOKIE |
MAM cookie/token used for searching (mam_id=... or full cookie header) |
While optional it is recommended to configure ABS_BASE_URL and ABS_ADMIN_USER for full functionality.
| Variable | Default | Description |
|---|---|---|
ABS_BASE_URL |
(none) | Base URL for Audiobookshelf (enables login + covers + verification) |
ABS_ADMIN_USER |
(none) | ABS username treated as “admin” for library-management actions |
MAX_COVERS_SIZE_MB |
500 |
Max disk space for cached covers (0 = no limit; direct-fetch-only is not recommended) |
ABS_VERIFY_TIMEOUT |
10 |
Timeout (seconds) for import verification |
ABS_CHECK_LIBRARY |
true when ABS configured |
Show “already in library” indicators |
ABS_LIBRARY_CACHE_TTL |
300 |
Cache TTL (seconds) for library presence checks |
| Variable | Default | Description |
|---|---|---|
IMPORT_MODE |
link |
link (hardlink), copy, or move |
FLATTEN_DISCS |
true |
Flatten multi-disc audiobooks into a single sequence |
DL_DIR |
/media/torrents |
In-container downloads path |
LIB_DIR |
/media/Books/Audiobooks |
In-container library path |
QB_CATEGORY |
shelfarr |
Category assigned to new torrents |
QB_POSTIMPORT_CATEGORY |
(empty) | Category to set after import (empty = none/clear) |
| Variable | Default | Description |
|---|---|---|
HARDCOVER_API_TOKEN |
(none) | Hardcover GraphQL token for series discovery |
HARDCOVER_CACHE_TTL |
300 |
Cache TTL (seconds) for series lookups |
HARDCOVER_RATE_LIMIT |
60 |
Requests per minute (Hardcover API limit: 60/min) |
HARDCOVER_SERIES_LIMIT |
20 |
Default number of series results to fetch |
| A hardcover api key can be obtained by creating a free hardcover account. |
- Open the Discover view.
- Enter title, author, or narrator.
- Add results to qBittorrent or open details.
a) Auto import
- Go to Gear Icon and toggle auto import feature on.
b) Manual Import
- Open the History view.
- Wait for qBittorrent to finish the download.
- Click Import and confirm.
- If ABS is configured and you’re logged in, ShelfArr verifies the import automatically and when you click verify.
- SPA entrypoint: Vite builds land in
app/static/dist/withindex.htmlserved for all non-API routes. FastAPI mounts/staticand provides the SPA fallback inapp/main.py. - Backend role: FastAPI exposes API routes under
app/routes/(/search,/history,/import,/qb,/logs,/series,/covers,/config,/health) and defers HTML to the SPA index. - Routing: Vue Router runs in history mode with a catch-all redirect for unknown paths. Deep links and refreshes resolve through the FastAPI fallback.
- Styling system: UnoCSS atomic utilities with custom shortcuts (
build/frontend/uno.config.js), global CSS variables inbuild/frontend/src/styles/global.css, and Naive UI theme overrides inbuild/frontend/src/theme/naive.js.
- Docker compose fails with “network nginx-network declared as external, but could not be found”: Run
docker network create nginx-networkor remove the external network fromdocker-compose.yml. - Import fails with “path not found”: Confirm your
/mediamount contains both the downloads and library directories and thatDL_DIR/LIB_DIRmatch your structure. - Permission errors: Set
PUID,PGID, andUMASKto match your host and rebuild the container. - MAM searches fail: Refresh your MAM cookie and restart the container.
- ABS features disabled: Set
ABS_BASE_URL, restart, then log in via the UI.
- In-app: open the SPA Logs view at
/logs(rendered by Vue, fed by API). - CLI:
docker compose logs -for view log files inside the mountedDATA_DIR.
docs/BACKEND.md– FastAPI architecture, routing, dependencies, and SPA fallback behavior.docs/FRONTEND.md– Vue SPA architecture, routing map, components, styling, and Naive UI theme.docs/TESTING.md– Testing guide: local and container-based testing, Selenium integration.
- Docker & Docker Compose
- qBittorrent with WebUI enabled
- Valid MAM session cookie
- (Optional) Audiobookshelf instance for covers and verification
MIT - Provided as-is, no warranty. Personal-use tooling only.