torznab

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package torznab implements the Torznab indexer plugin for Pilot. Torznab is an RSS/Atom-style XML protocol used by Prowlarr and Jackett to expose torrent indexers over a common API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL       string `json:"url"`
	APIKey    string `json:"api_key,omitempty"`
	RateLimit int    `json:"rate_limit,omitempty"` // requests per minute; 0 = unlimited
}

Config holds the user-supplied settings for a Torznab indexer instance.

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

Indexer is a Torznab indexer plugin instance.

func New

func New(cfg Config) *Indexer

New creates a new Torznab Indexer from the given config.

30s per-call timeout matches Newznab and matches Sonarr/Radarr defaults. A higher value (we used to ship 180s) means a single misbehaving indexer — Cloudflare-walled, dead, or overloaded — pins an interactive search for the worst case before all the parallel goroutines finish.

func (*Indexer) Capabilities

func (idx *Indexer) Capabilities(ctx context.Context) (plugin.Capabilities, error)

Capabilities fetches and parses the indexer's capabilities document.

func (*Indexer) GetRecent

func (idx *Indexer) GetRecent(ctx context.Context) ([]plugin.Release, error)

GetRecent returns the most recent releases from the indexer's RSS feed.

func (*Indexer) Name

func (idx *Indexer) Name() string

Name returns the human-readable plugin name.

func (*Indexer) Protocol

func (idx *Indexer) Protocol() plugin.Protocol

Protocol returns the protocol this indexer serves.

func (*Indexer) Search

func (idx *Indexer) Search(ctx context.Context, q plugin.SearchQuery) ([]plugin.Release, error)

Search queries the indexer for releases matching q.

Strategy:

  1. Try the TV search endpoint (?t=tvsearch) with season/episode params. This lets the indexer filter server-side for better results. If TVDBID is available, include it for more precise matching.
  2. Fall back to free-text search (?t=search&q=…) which is universally supported. The caller is expected to pass a well-formed show query in q.Query (e.g. "Breaking Bad S01E05").

func (*Indexer) Test

func (idx *Indexer) Test(ctx context.Context) error

Test checks that the indexer is reachable and returns a valid capabilities response. Returns a non-nil error if connectivity or configuration fails.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL