Skip to content

Content Classification

Michael edited this page Jul 17, 2026 · 2 revisions

Content Classification

bitmagnet identifies and enriches torrents through a multi-stage classifier pipeline. The classifier is a YAML workflow engine that runs a series of actions on each torrent.


Pipeline overview

DHT/Prowlarr discovers torrent
    → Torrent enters classification queue
    → Name parsing extracts title, year, content type hints
    → TMDB lookup matches to a movie/TV show (assigns IMDB ID)
    → OMDb lookup enriches with ratings, awards, box office
    → Content stored with full metadata

TMDB

TMDB is the primary classification source. It matches parsed torrent names to movies and TV shows, providing poster art, genres, cast/crew, release dates, and IMDB IDs.

Config:

tmdb:
  enabled: true    # default: true

Or via environment variable: TMDB_API_KEY=your_key

TMDB's free tier rate limits to ~1 request/second. The classifier has built-in fail-fast logic — if TMDB returns repeated errors, it temporarily disables lookups and re-enables automatically when connectivity returns.


OMDb

OMDb runs after TMDB for any content that has an IMDB ID. It adds Rotten Tomatoes scores, Metacritic ratings, awards, box office data, and detailed plot summaries. See OMDb Enrichment for full setup.


ThePornDB

TMDB does not cover adult content, so this fork adds an optional ThePornDB (TPDB) classifier that matches and titles XXX torrents. It runs in the same pipeline, is disabled by default, and requires an API key. See ThePornDB Classification for full setup.


Classifier flags

The classifier YAML workflow uses flags to control which actions run:

Flag Default Description
tmdb_enabled true Run TMDB lookups
omdb_enabled true Run OMDb lookups (requires config)
tpdb_enabled false Run ThePornDB lookups for adult content (requires config)

Both DHT and Prowlarr torrents run through the same pipeline with the same flags. There is no per-source classification difference.


Queue backpressure

The classification queue has a configurable depth limit (max_queue_depth in dht_crawler config). When the queue exceeds this limit, new torrents are still written to the database but skipped for classification until the queue drains. This prevents unbounded queue_jobs table growth under TMDB rate limits.

Clone this wiki locally