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 ¶
- type Config
- type Indexer
- func (idx *Indexer) Capabilities(ctx context.Context) (plugin.Capabilities, error)
- func (idx *Indexer) GetRecent(ctx context.Context) ([]plugin.Release, error)
- func (idx *Indexer) Name() string
- func (idx *Indexer) Protocol() plugin.Protocol
- func (idx *Indexer) Search(ctx context.Context, q plugin.SearchQuery) ([]plugin.Release, error)
- func (idx *Indexer) Test(ctx context.Context) error
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 ¶
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 ¶
Capabilities fetches and parses the indexer's capabilities document.
func (*Indexer) Search ¶
Search queries the indexer for releases matching q.
Strategy:
- 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.
- 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").