jackett

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CategoryAll represents all categories
	CategoryAll = "0"

	// TV Categories
	CategoryTV        = "5000"
	CategoryTVSD      = "5030"
	CategoryTVHD      = "5040"
	CategoryTVUHD     = "5045"
	CategoryTVForeign = "5020"
	CategoryTVSport   = "5060"
	CategoryTVAnime   = "5070"
	CategoryTVDocumen = "5080"
	CategoryTVOther   = "5090"
	CategoryTVWeb     = "5010"

	// Movie Categories
	CategoryMovies        = "2000"
	CategoryMoviesForeign = "2010"
	CategoryMoviesOther   = "2020"
	CategoryMoviesSD      = "2030"
	CategoryMoviesHD      = "2040"
	CategoryMoviesUHD     = "2045"
	CategoryMoviesBluRay  = "2050"
	CategoryMovies3D      = "2060"
	CategoryMoviesWeb     = "2070"

	// Music Categories
	CategoryAudio          = "3000"
	CategoryAudioMP3       = "3010"
	CategoryAudioVideo     = "3020"
	CategoryAudioAudiobook = "3030"
	CategoryAudioLossless  = "3040"
	CategoryAudioOther     = "3050"
	CategoryAudioForeign   = "3060"

	// PC Categories
	CategoryPC             = "4000"
	CategoryPC0day         = "4010"
	CategoryPCISO          = "4020"
	CategoryPCMac          = "4030"
	CategoryPCPhoneOther   = "4040"
	CategoryPCGames        = "4050"
	CategoryPCPhoneIOS     = "4060"
	CategoryPCPhoneAndroid = "4070"

	// XXX Categories
	CategoryXXX         = "6000"
	CategoryXXXDVD      = "6010"
	CategoryXXXWMV      = "6020"
	CategoryXXXXviD     = "6030"
	CategoryXXXx264     = "6040"
	CategoryXXXUHD      = "6045"
	CategoryXXXPack     = "6050"
	CategoryXXXImageSet = "6060"
	CategoryXXXOther    = "6070"
	CategoryXXXSD       = "6080"
	CategoryXXXWeb      = "6090"

	// Other Categories
	CategoryOther       = "7000"
	CategoryOtherMisc   = "7010"
	CategoryOtherHashed = "7020"

	// Books Categories
	CategoryBooks          = "8000"
	CategoryBooksMags      = "8010"
	CategoryBooksEBook     = "8020"
	CategoryBooksComics    = "8030"
	CategoryBooksTechnical = "8040"
	CategoryBooksForeign   = "8050"
	CategoryBooksOther     = "8060"
)
View Source
const (
	AttrSize                 = "size"
	AttrCategory             = "category"
	AttrTag                  = "tag"
	AttrGUID                 = "guid"
	AttrFiles                = "files"
	AttrPoster               = "poster"
	AttrGroup                = "group"
	AttrTeam                 = "team"
	AttrGrabs                = "grabs"
	AttrSeeders              = "seeders"
	AttrPeers                = "peers"
	AttrLeechers             = "leechers"
	AttrInfoHash             = "infohash"
	AttrMagnetURL            = "magneturl"
	AttrDownloadVolumeFactor = "downloadvolumefactor"
	AttrUploadVolumeFactor   = "uploadvolumefactor"
	AttrMinimumRatio         = "minimumratio"
	AttrMinimumSeedTime      = "minimumseedtime"

	// TV attributes
	AttrSeason    = "season"
	AttrEpisode   = "episode"
	AttrTVDBID    = "tvdbid"
	AttrTVMazeID  = "tvmazeid"
	AttrTVRageID  = "rageid"
	AttrTVTitle   = "tvtitle"
	AttrTVAirDate = "tvairdate"

	// Movie attributes
	AttrIMDB      = "imdb"
	AttrIMDBID    = "imdbid"
	AttrTMDBID    = "tmdbid"
	AttrIMDBScore = "imdbscore"
	AttrIMDBTitle = "imdbtitle"
	AttrIMDBYear  = "imdbyear"

	// General media attributes
	AttrGenre      = "genre"
	AttrYear       = "year"
	AttrLanguage   = "language"
	AttrSubtitles  = "subs"
	AttrVideo      = "video"
	AttrAudio      = "audio"
	AttrResolution = "resolution"
	AttrFramerate  = "framerate"

	// Music attributes
	AttrArtist    = "artist"
	AttrAlbum     = "album"
	AttrLabel     = "label"
	AttrTrack     = "track"
	AttrPublisher = "publisher"

	// Book attributes
	AttrBookTitle   = "booktitle"
	AttrAuthor      = "author"
	AttrPublishDate = "publishdate"
	AttrPages       = "pages"
)

Common torznab attribute names

Variables

View Source
var (
	DefaultTimeout = 60 * time.Second
)

Functions

This section is empty.

Types

type BookSearchOptions

type BookSearchOptions struct {
	Query    string // Free text query
	Author   string // Author name
	Title    string // Book title
	Year     string // Publication year
	Genre    string // Genre filter
	Limit    string // Number of results to return
	Offset   string // Number of results to skip
	Category string // Comma-separated category IDs (defaults to Book categories)
	Extended string // Set to "1" to include all extended attributes
}

BookSearchOptions represents parameters for book searches

type Client

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

func NewClient

func NewClient(cfg Config) *Client

func (*Client) BookSearch

func (c *Client) BookSearch(opts BookSearchOptions) (Rss, error)

BookSearch performs a book-specific search with the given options

func (*Client) BookSearchCtx

func (c *Client) BookSearchCtx(ctx context.Context, opts BookSearchOptions) (Rss, error)

BookSearchCtx performs a book-specific search with context

func (*Client) GetCapsDirect

func (c *Client) GetCapsDirect() (Indexers, error)

GetCapsDirect retrieves the capabilities of a direct tracker torznab API

func (*Client) GetCapsDirectCtx

func (c *Client) GetCapsDirectCtx(ctx context.Context) (Indexers, error)

GetCapsDirectCtx retrieves the capabilities of a direct tracker torznab API with context

func (*Client) GetEnclosure

func (c *Client) GetEnclosure(enclosure string) ([]byte, error)

func (*Client) GetEnclosureCtx

func (c *Client) GetEnclosureCtx(ctx context.Context, enclosure string) ([]byte, error)

func (*Client) GetIndexers

func (c *Client) GetIndexers() (Indexers, error)

func (*Client) GetIndexersCtx

func (c *Client) GetIndexersCtx(ctx context.Context) (Indexers, error)

func (*Client) GetTorrents

func (c *Client) GetTorrents(indexer string, opts map[string]string) (Rss, error)

func (*Client) GetTorrentsCtx

func (c *Client) GetTorrentsCtx(ctx context.Context, indexer string, opts map[string]string) (Rss, error)

func (*Client) MovieSearch

func (c *Client) MovieSearch(opts MovieSearchOptions) (Rss, error)

MovieSearch performs a movie-specific search with the given options

func (*Client) MovieSearchCtx

func (c *Client) MovieSearchCtx(ctx context.Context, opts MovieSearchOptions) (Rss, error)

MovieSearchCtx performs a movie-specific search with context

func (*Client) MusicSearch

func (c *Client) MusicSearch(opts MusicSearchOptions) (Rss, error)

MusicSearch performs a music-specific search with the given options

func (*Client) MusicSearchCtx

func (c *Client) MusicSearchCtx(ctx context.Context, opts MusicSearchOptions) (Rss, error)

MusicSearchCtx performs a music-specific search with context

func (*Client) SearchDirect

func (c *Client) SearchDirect(query string, opts map[string]string) (Rss, error)

SearchDirect performs a direct search against a tracker's torznab API This is useful for trackers that expose their own torznab endpoints Example: client configured with Host="https://www.morethantv.me/api/torznab" and DirectMode=true

func (*Client) SearchDirectCtx

func (c *Client) SearchDirectCtx(ctx context.Context, query string, opts map[string]string) (Rss, error)

SearchDirectCtx performs a direct search against a tracker's torznab API with context

func (*Client) TVSearch

func (c *Client) TVSearch(opts TVSearchOptions) (Rss, error)

TVSearch performs a TV-specific search with the given options

func (*Client) TVSearchCtx

func (c *Client) TVSearchCtx(ctx context.Context, opts TVSearchOptions) (Rss, error)

TVSearchCtx performs a TV-specific search with context

type Config

type Config struct {
	Host   string
	APIKey string

	// TLS skip cert validation
	TLSSkipVerify bool

	// HTTP Basic auth username
	BasicUser string

	// HTTP Basic auth password
	BasicPass string

	Timeout int
	Log     *log.Logger

	// DirectMode enables direct tracker API access instead of proxying through Jackett
	// When true, Host should be the direct tracker URL (e.g., https://www.morethantv.me/api/torznab)
	DirectMode bool
}

type Indexers

type Indexers struct {
	XMLName xml.Name `xml:"indexers"`
	Text    string   `xml:",chardata"`
	Indexer []struct {
		Text        string `xml:",chardata"`
		ID          string `xml:"id,attr"`
		Configured  string `xml:"configured,attr"`
		Title       string `xml:"title"`
		Description string `xml:"description"`
		Link        string `xml:"link"`
		Language    string `xml:"language"`
		Type        string `xml:"type"`
		Caps        struct {
			Text   string `xml:",chardata"`
			Server struct {
				Text  string `xml:",chardata"`
				Title string `xml:"title,attr"`
			} `xml:"server"`
			Limits struct {
				Text    string `xml:",chardata"`
				Default string `xml:"default,attr"`
				Max     string `xml:"max,attr"`
			} `xml:"limits"`
			Searching struct {
				Text   string `xml:",chardata"`
				Search struct {
					Text            string `xml:",chardata"`
					Available       string `xml:"available,attr"`
					SupportedParams string `xml:"supportedParams,attr"`
					SearchEngine    string `xml:"searchEngine,attr"`
				} `xml:"search"`
				TvSearch struct {
					Text            string `xml:",chardata"`
					Available       string `xml:"available,attr"`
					SupportedParams string `xml:"supportedParams,attr"`
					SearchEngine    string `xml:"searchEngine,attr"`
				} `xml:"tv-search"`
				MovieSearch struct {
					Text            string `xml:",chardata"`
					Available       string `xml:"available,attr"`
					SupportedParams string `xml:"supportedParams,attr"`
					SearchEngine    string `xml:"searchEngine,attr"`
				} `xml:"movie-search"`
				MusicSearch struct {
					Text            string `xml:",chardata"`
					Available       string `xml:"available,attr"`
					SupportedParams string `xml:"supportedParams,attr"`
					SearchEngine    string `xml:"searchEngine,attr"`
				} `xml:"music-search"`
				AudioSearch struct {
					Text            string `xml:",chardata"`
					Available       string `xml:"available,attr"`
					SupportedParams string `xml:"supportedParams,attr"`
					SearchEngine    string `xml:"searchEngine,attr"`
				} `xml:"audio-search"`
				BookSearch struct {
					Text            string `xml:",chardata"`
					Available       string `xml:"available,attr"`
					SupportedParams string `xml:"supportedParams,attr"`
					SearchEngine    string `xml:"searchEngine,attr"`
				} `xml:"book-search"`
			} `xml:"searching"`
			Categories struct {
				Text     string `xml:",chardata"`
				Category []struct {
					Text   string `xml:",chardata"`
					ID     string `xml:"id,attr"`
					Name   string `xml:"name,attr"`
					Subcat []struct {
						Text string `xml:",chardata"`
						ID   string `xml:"id,attr"`
						Name string `xml:"name,attr"`
					} `xml:"subcat"`
				} `xml:"category"`
			} `xml:"categories"`
		} `xml:"caps"`
	} `xml:"indexer"`
}

type MovieSearchOptions

type MovieSearchOptions struct {
	Query    string // Free text query
	IMDBID   string // IMDB ID (with or without tt prefix)
	TMDBID   string // The Movie Database ID
	Genre    string // Genre filter
	Year     string // Release year
	Limit    string // Number of results to return
	Offset   string // Number of results to skip
	Category string // Comma-separated category IDs (defaults to Movie categories)
	Extended string // Set to "1" to include all extended attributes
}

MovieSearchOptions represents parameters for movie searches

type MusicSearchOptions

type MusicSearchOptions struct {
	Query    string // Free text query
	Artist   string // Artist name
	Album    string // Album name
	Label    string // Record label
	Track    string // Track name
	Year     string // Release year
	Genre    string // Genre filter
	Limit    string // Number of results to return
	Offset   string // Number of results to skip
	Category string // Comma-separated category IDs (defaults to Audio categories)
	Extended string // Set to "1" to include all extended attributes
}

MusicSearchOptions represents parameters for music searches

type Rss

type Rss struct {
	XMLName xml.Name `xml:"rss"`
	Text    string   `xml:",chardata"`
	Version string   `xml:"version,attr"`
	Atom    string   `xml:"atom,attr"`
	Torznab string   `xml:"torznab,attr"`
	Channel struct {
		Text string `xml:",chardata"`
		Link struct {
			Text string `xml:",chardata"`
			Href string `xml:"href,attr"`
			Rel  string `xml:"rel,attr"`
			Type string `xml:"type,attr"`
		} `xml:"link"`
		Title       string `xml:"title"`
		Description string `xml:"description"`
		Language    string `xml:"language"`
		Category    string `xml:"category"`
		Item        []struct {
			Text           string `xml:",chardata"`
			Title          string `xml:"title"`
			Guid           string `xml:"guid"`
			Jackettindexer struct {
				Text string `xml:",chardata"`
				ID   string `xml:"id,attr"`
			} `xml:"jackettindexer"`
			Type        string   `xml:"type"`
			Comments    string   `xml:"comments"`
			PubDate     string   `xml:"pubDate"`
			Size        string   `xml:"size"`
			Files       string   `xml:"files"`
			Grabs       string   `xml:"grabs"`
			Description string   `xml:"description"`
			Link        string   `xml:"link"`
			Category    []string `xml:"category"`
			Enclosure   struct {
				Text   string `xml:",chardata"`
				URL    string `xml:"url,attr"`
				Length string `xml:"length,attr"`
				Type   string `xml:"type,attr"`
			} `xml:"enclosure"`
			Attr []struct {
				Text  string `xml:",chardata"`
				Name  string `xml:"name,attr"`
				Value string `xml:"value,attr"`
			} `xml:"attr"`
		} `xml:"item"`
	} `xml:"channel"`
}

func (*Rss) ToTorznabItems

func (r *Rss) ToTorznabItems() []TorznabItem

ToTorznabItems converts an RSS feed to a slice of TorznabItem with helper methods

type SearchType

type SearchType string

SearchType represents the type of search to perform

const (
	// SearchTypeSearch is a free text search
	SearchTypeSearch SearchType = "search"

	// SearchTypeTV is a TV-specific search
	SearchTypeTV SearchType = "tvsearch"

	// SearchTypeMovie is a movie-specific search
	SearchTypeMovie SearchType = "movie"

	// SearchTypeMusic is a music-specific search
	SearchTypeMusic SearchType = "music"

	// SearchTypeBook is a book-specific search
	SearchTypeBook SearchType = "book"

	// SearchTypeCaps retrieves indexer capabilities
	SearchTypeCaps SearchType = "caps"
)

type TVSearchOptions

type TVSearchOptions struct {
	Query    string // Free text query
	TVDBID   string // TheTVDB ID
	TVMazeID string // TVMaze ID
	RageID   string // TVRage ID (deprecated but still supported)
	Season   string // Season number
	Episode  string // Episode number
	IMDBID   string // IMDB ID (some indexers support this for TV)
	Limit    string // Number of results to return
	Offset   string // Number of results to skip
	Category string // Comma-separated category IDs (defaults to TV categories)
	Extended string // Set to "1" to include all extended attributes
}

TVSearchOptions represents parameters for TV show searches

type TorznabError

type TorznabError struct {
	Code    string `xml:"code,attr"`
	Message string `xml:",chardata"`
}

TorznabError represents a Torznab error response

type TorznabItem

type TorznabItem struct {
	Title           string
	Guid            string
	Link            string
	Comments        string
	PubDate         string
	Description     string
	Size            string
	Files           string
	Grabs           string
	Category        []string
	EnclosureURL    string
	EnclosureLength string
	Attributes      map[string][]string // Map of attribute name to values (attributes can have multiple values)
}

TorznabItem represents a single RSS item with helper methods for accessing torznab attributes

func (*TorznabItem) Album

func (t *TorznabItem) Album() string

Album returns the album name for music

func (*TorznabItem) Artist

func (t *TorznabItem) Artist() string

Artist returns the artist name for music

func (*TorznabItem) Audio

func (t *TorznabItem) Audio() string

Audio returns the audio codec information

func (*TorznabItem) Author

func (t *TorznabItem) Author() string

Author returns the author name for books

func (*TorznabItem) BookTitle

func (t *TorznabItem) BookTitle() string

BookTitle returns the book title

func (*TorznabItem) Categories

func (t *TorznabItem) Categories() []string

Categories returns all category IDs as strings

func (*TorznabItem) DownloadVolumeFactor

func (t *TorznabItem) DownloadVolumeFactor() float64

DownloadVolumeFactor returns the download volume factor (0.0 = freeleech)

func (*TorznabItem) Episode

func (t *TorznabItem) Episode() int

Episode returns the episode number for TV shows

func (*TorznabItem) Genre

func (t *TorznabItem) Genre() string

Genre returns the genre

func (*TorznabItem) GetAttr

func (t *TorznabItem) GetAttr(name string) string

GetAttr retrieves the first value of an attribute by name

func (*TorznabItem) GetAttrFloat

func (t *TorznabItem) GetAttrFloat(name string) float64

GetAttrFloat retrieves an attribute as a float64

func (*TorznabItem) GetAttrInt

func (t *TorznabItem) GetAttrInt(name string) int

GetAttrInt retrieves an attribute as an integer

func (*TorznabItem) GetAttrInt64

func (t *TorznabItem) GetAttrInt64(name string) int64

GetAttrInt64 retrieves an attribute as an int64

func (*TorznabItem) GetAttrValues

func (t *TorznabItem) GetAttrValues(name string) []string

GetAttrValues retrieves all values of an attribute by name

func (*TorznabItem) HasTag

func (t *TorznabItem) HasTag(tag string) bool

HasTag checks if the item has a specific tag

func (*TorznabItem) IMDBID

func (t *TorznabItem) IMDBID() string

IMDBID returns the IMDB ID for movies/shows

func (*TorznabItem) InfoHash

func (t *TorznabItem) InfoHash() string

InfoHash returns the torrent info hash

func (*TorznabItem) IsFreeleech

func (t *TorznabItem) IsFreeleech() bool

IsFreeleech returns true if the torrent is freeleech (downloadvolumefactor = 0)

func (*TorznabItem) Language

func (t *TorznabItem) Language() string

Language returns the language

func (*TorznabItem) Leechers

func (t *TorznabItem) Leechers() int

Leechers returns the number of leechers

func (*TorznabItem) MagnetURL

func (t *TorznabItem) MagnetURL() string

MagnetURL returns the magnet link

func (*TorznabItem) MinimumRatio

func (t *TorznabItem) MinimumRatio() float64

MinimumRatio returns the minimum ratio requirement

func (*TorznabItem) MinimumSeedTime

func (t *TorznabItem) MinimumSeedTime() int64

MinimumSeedTime returns the minimum seed time in seconds

func (*TorznabItem) Peers

func (t *TorznabItem) Peers() int

Peers returns the total number of peers (seeders + leechers)

func (*TorznabItem) Resolution

func (t *TorznabItem) Resolution() string

Resolution returns the video resolution (e.g., "1920x1080")

func (*TorznabItem) Season

func (t *TorznabItem) Season() int

Season returns the season number for TV shows

func (*TorznabItem) Seeders

func (t *TorznabItem) Seeders() int

Seeders returns the number of seeders

func (*TorznabItem) Subtitles

func (t *TorznabItem) Subtitles() string

Subtitles returns the subtitle languages

func (*TorznabItem) TMDBID

func (t *TorznabItem) TMDBID() string

TMDBID returns the TMDB ID for movies

func (*TorznabItem) TVDBID

func (t *TorznabItem) TVDBID() string

TVDBID returns the TVDB ID for TV shows

func (*TorznabItem) TVMazeID

func (t *TorznabItem) TVMazeID() string

TVMazeID returns the TVMaze ID for TV shows

func (*TorznabItem) Tags

func (t *TorznabItem) Tags() []string

Tags returns all tag values

func (*TorznabItem) UploadVolumeFactor

func (t *TorznabItem) UploadVolumeFactor() float64

UploadVolumeFactor returns the upload volume factor

func (*TorznabItem) Video

func (t *TorznabItem) Video() string

Video returns the video codec information

func (*TorznabItem) Year

func (t *TorznabItem) Year() int

Year returns the release year

Jump to

Keyboard shortcuts

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