prowlarr

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Prowlarr API Client. Prowlarr docs: https://prowlarr.com/docs/api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(url, apiKey string) *Client

func (*Client) GetAPIVersion

func (c *Client) GetAPIVersion() (string, error)

func (*Client) GetIndexers

func (c *Client) GetIndexers() ([]Indexer, error)

func (*Client) Search

func (c *Client) Search(config *SearchConfig) ([]SearchResult, error)

Search performs a search on Prowlarr.

type Indexer

type Indexer struct {
	ID          int      `json:"id"`
	Protocol    string   `json:"protocol"`
	Name        string   `json:"name"`
	Enable      bool     `json:"enable"`
	IndexerUrls []string `json:"indexerUrls"`
}

Indexer represents a Prowlarr indexer (Tracker).

type SearchConfig

type SearchConfig struct {
	Indexers  []int // Indexer IDs
	Limit     int   // Limit the number of results. Currently not working in Prowlarr
	Offset    int   // Offset the number of results. Currently not working in Prowlarr
	FreeLeech bool  // Only return freeleech torrents
}

SearchConfig represents the search configuration.

type SearchResult

type SearchResult struct {
	Size         uint     `json:"size"`
	IndexerID    int      `json:"indexerId"`
	Title        string   `json:"title"`
	FileName     string   `json:"fileName"`
	DownloadURL  string   `json:"downloadUrl"`
	IndexerFlags []string `json:"indexerFlags"`
	Seeders      int      `json:"seeders"`
	Leechers     int      `json:"leechers"`
	Protocol     string   `json:"protocol"`
}

SearchResult represents a search result from Prowlarr.

func (*SearchResult) IsFreeleech

func (s *SearchResult) IsFreeleech() bool

IsFreeleech returns true if the search result is freeleech.

Jump to

Keyboard shortcuts

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