indexer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnreachable      = errors.New("indexer unreachable")
	ErrUnauthorized     = errors.New("indexer credentials rejected")
	ErrUnexpectedStatus = errors.New("indexer returned unexpected status")
	ErrBadResponse      = errors.New("indexer returned malformed response")
)

Categorised torznab failures. Handlers map these to 422 with friendly messages; anything not matching is treated as a 500 internal error.

Functions

This section is empty.

Types

type Client

type Client interface {
	Search(ctx context.Context, params SearchParams) ([]SearchResult, error)
	Feed(ctx context.Context) ([]SearchResult, error)
	TestConnection(ctx context.Context) error
}

type Manager

type Manager interface {
	Test(ctx context.Context, p TestParams) error
	TestByName(ctx context.Context, name string) error
	SearchMovie(
		ctx context.Context,
		titles []string,
		tmdbID uint32,
	) ([]SearchResult, error)
	SearchSeason(
		ctx context.Context,
		titles []string,
		tvdbID uint32,
		season uint16,
	) ([]SearchResult, error)
	SearchSeries(
		ctx context.Context,
		titles []string,
		tvdbID uint32,
	) ([]SearchResult, error)
	SearchEpisode(
		ctx context.Context,
		titles []string,
		tvdbID uint32,
		season, episode uint16,
	) ([]SearchResult, error)
	Feed(ctx context.Context, indexerName string) ([]SearchResult, error)
}

Manager is the consumer-facing surface used by HTTP handlers and rss. CRUD over indexers lives in the YAML config (config.AddIndexer etc.); this surface keeps the behavioral operations that act on the configured entries.

func New

func New() Manager

type Prowlarr

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

Prowlarr queries a Prowlarr instance's native search API (GET /api/v1/search), which aggregates across every indexer Prowlarr manages in one call. Unlike Jackett, Prowlarr exposes no combined Torznab feed — its per-indexer Torznab endpoints (/{id}/api) only hit one tracker — so a dedicated JSON client is the only way to "query all indexers".

func NewProwlarr

func NewProwlarr(baseURL, apiKey string) *Prowlarr

func (*Prowlarr) Feed

func (p *Prowlarr) Feed(context.Context) ([]SearchResult, error)

Feed has no analogue in Prowlarr. Per the Servarr wiki, "an aggregate multi-indexer endpoint will not be added", and the search API requires a query — so there is no cross-indexer latest-releases feed to forward. rss-sync gets nothing for a Prowlarr entry, which is correct: RSS monitoring belongs on the individual trackers.

func (*Prowlarr) Search

func (p *Prowlarr) Search(
	ctx context.Context,
	params SearchParams,
) ([]SearchResult, error)

func (*Prowlarr) TestConnection

func (p *Prowlarr) TestConnection(ctx context.Context) error

type SearchParams

type SearchParams struct {
	Query   string
	IMDBID  string
	TMDBID  uint32
	TVDBID  uint32
	Season  uint16
	Episode uint16
}

type SearchResult

type SearchResult struct {
	Title       string
	InfoURL     string
	Download    string
	Size        int64
	Seeders     uint32
	Leechers    uint32
	Category    string
	PublishDate time.Time
	// Indexer is the configured name of the indexer this result came from.
	// Stamped by the search service during cross-indexer aggregation.
	Indexer string
}

type TestParams

type TestParams struct {
	Protocol string
	Host     string
	Port     uint16
	Path     string
	UseSSL   bool
	APIKey   string
}

TestParams describes ad-hoc credentials for a connection test that has not yet been persisted as an Indexer row.

type Torznab

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

func NewTorznab

func NewTorznab(baseURL, apiKey string) *Torznab

func (*Torznab) Feed

func (t *Torznab) Feed(ctx context.Context) ([]SearchResult, error)

Feed performs a forward-feed query (`t=search` with no `q`), returning the indexer's recent items. Used by the rss-sync feed scanner.

func (*Torznab) Search

func (t *Torznab) Search(
	ctx context.Context,
	params SearchParams,
) ([]SearchResult, error)

func (*Torznab) TestConnection

func (t *Torznab) TestConnection(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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