Clean SABnzbd history and warnings of content you'd prefer to keep private
  • TypeScript 92.5%
  • Dockerfile 7.5%
Find a file
2026-03-18 00:55:26 -05:00
.github/workflows build: use docker buildx 2026-03-18 00:55:26 -05:00
.gitignore chore: update Node to 24 LTS, yarn to 4.13.0, and deps to current (#4) 2026-03-17 20:29:53 -05:00
.prettierrc.json search filename for category, cleanup 2023-12-31 01:08:17 -06:00
.yarnrc.yml chore: update Node to 24 LTS, yarn to 4.13.0, and deps to current (#4) 2026-03-17 20:29:53 -05:00
api.ts refactor: simplify nzoIds join and use nullish coalescing for limit 2026-03-18 00:55:26 -05:00
Dockerfile chore: update Node to 24 LTS, yarn to 4.13.0, and deps to current (#4) 2026-03-17 20:29:53 -05:00
package.json chore: update Node to 24 LTS, yarn to 4.13.0, and deps to current (#4) 2026-03-17 20:29:53 -05:00
README.md Add LOG_NAMES env. var 2024-01-05 15:50:39 -06:00
sanitize.ts refactor: pass filterFn directly to Array.filter 2026-03-18 00:55:26 -05:00
tsconfig.json chore: update Node to 24 LTS, yarn to 4.13.0, and deps to current (#4) 2026-03-17 20:29:53 -05:00
util.ts fix: pluralize correctly for 0 and empty arrays 2026-03-18 00:55:26 -05:00
yarn.lock chore: update Node to 24 LTS, yarn to 4.13.0, and deps to current (#4) 2026-03-17 20:29:53 -05:00

sabnzbd-sanitizer

This tiny Node app polls your SABnzbd history via API and removes one or more categories of NZBs.

It will poll often after finding something that requires cleaning, and slow down in periods of inactivity.

Additionally, by default, the script will clear ALL warnings/errors if ANY are found to include the name of the specified categories, as this might leak information about those categories. For this feature to work as expected, it is recommended to download the specified categories into file paths that include the category name. This behavior can be disabled by setting CLEAR_WARNINGS to false.

Configuration

Requires setting environment variables for which a default is not supplied.

Environment Variable Description Example Default
API_URL The full URL to your SABnzbd API http://192.168.1.100:8080/api No default
API_KEY Your API key 3c64cc70468348138aa2964d257a7108 No default
CATEGORIES A comma-separated list of categories to purge from history movies,music No default
MAX_POLL_SECS Max number of seconds between checks 60 300
CLEAR_WARNINGS Clear all warnings if any contain the name of a category false true
LOG_NAMES Optionally log NZB names for debugging true false

Usage

I recommend you add the service to your SABnzbd stack's docker-compose.yml:

sanitizer:
  image: treyturner/sabnzbd-sanitizer
  container_name: sabnzbd_sanitizer
  environment:
    - API_URL=http://your.ip.address.here:8080/api
    - API_KEY=your_sabnzbd_api_key
    - CATEGORIES=yyy
  restart: unless-stopped

If you aren't using docker-compose, you can start a container without it:

docker run -d --rm \
  -e API_URL=http://your.ip.address.here:8080/api \
  -e API_KEY=your_sabnzbd_api_key \
  -e CATEGORIES=yyy \
  treyturner/sabnzbd-sanitizer