jackett

package module
v0.0.0-...-88ab5d1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 14 Imported by: 0

README

go-jackett

Go library for communicating with Jackett and torznab APIs.

Features

  • Proxy searches through Jackett to multiple indexers
  • Direct communication with tracker torznab APIs (bypassing Jackett)
  • Proper HTTP connection reuse with drain-and-close pattern
  • Context support for timeout and cancellation
  • Retry logic with exponential backoff

Installation

go get github.com/autobrr/go-jackett

Usage

Jackett Proxy Mode (Default)

Use Jackett as a proxy to search multiple indexers:

package main

import (
    "fmt"
    "log"
    "github.com/autobrr/go-jackett"
)

func main() {
    client := jackett.NewClient(jackett.Config{
        Host:   "http://localhost:9117",
        APIKey: "your-jackett-api-key",
    })

    // Search all indexers via Jackett
    opts := map[string]string{
        "t": "search",
        "q": "ubuntu",
    }
    
    results, err := client.GetTorrents("all", opts)
    if err != nil {
        log.Fatal(err)
    }
    
    fmt.Printf("Found %d results\n", len(results.Channel.Items))
}
Direct Tracker Mode

Connect directly to a tracker's torznab API (e.g., MoreThanTV, RED, etc.):

package main

import (
    "fmt"
    "log"
    "github.com/autobrr/go-jackett"
)

func main() {
    client := jackett.NewClient(jackett.Config{
        Host:       "https://www.morethantv.me/api/torznab",
        APIKey:     "your-tracker-api-key",
        DirectMode: true, // Enable direct mode
        Timeout:    30,
    })

    // Search directly on the tracker
    results, err := client.SearchDirect("ubuntu", map[string]string{
        "limit": "50",
        "cat":   "5000", // TV category
    })
    if err != nil {
        log.Fatal(err)
    }
    
    fmt.Printf("Found %d results\n", len(results.Channel.Items))
    
    // Get tracker capabilities
    caps, err := client.GetCapsDirect()
    if err != nil {
        log.Fatal(err)
    }
    
    fmt.Printf("Tracker: %s\n", caps.Indexer[0].Title)
}
Using Context

All methods have context-aware variants for timeout and cancellation:

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

results, err := client.SearchDirectCtx(ctx, "debian", nil)
if err != nil {
    log.Fatal(err)
}

Configuration Options

Option Type Description
Host string Jackett URL or direct tracker torznab URL
APIKey string API key for authentication
DirectMode bool Enable direct tracker mode (bypass Jackett)
TLSSkipVerify bool Skip TLS certificate verification
BasicUser string HTTP Basic auth username
BasicPass string HTTP Basic auth password
Timeout int Request timeout in seconds (default: 60)
Log *log.Logger Custom logger

Specialized Search Methods

The library now supports all torznab search types as defined in the torznab specification:

Search for TV shows with specific parameters:

results, err := client.TVSearch(jackett.TVSearchOptions{
    Query:    "The Expanse",
    TVDBID:   "280619",
    Season:   "6",
    Episode:  "5",
    Category: jackett.CategoryTVHD,
})

// Process results with helper methods
items := results.ToTorznabItems()
for _, item := range items {
    fmt.Printf("Title: %s\n", item.Title)
    fmt.Printf("Seeders: %d, Leechers: %d\n", item.Seeders(), item.Leechers())
    fmt.Printf("Freeleech: %v\n", item.IsFreeleech())
    fmt.Printf("InfoHash: %s\n", item.InfoHash())
}

TVSearchOptions fields:

  • Query - Free text search
  • TVDBID - TheTVDB ID
  • TVMazeID - TVMaze ID
  • RageID - TVRage ID (deprecated)
  • Season - Season number
  • Episode - Episode number
  • Category - Category filter (use constants like CategoryTVHD)
  • Limit, Offset, Extended

Search for movies with IMDB/TMDB support:

results, err := client.MovieSearch(jackett.MovieSearchOptions{
    IMDBID:   "tt0816692",  // Interstellar
    Year:     "2014",
    Category: jackett.CategoryMoviesHD,
})

items := results.ToTorznabItems()
for _, item := range items {
    fmt.Printf("%s - %s\n", item.Title, item.Resolution())
    fmt.Printf("IMDB: %s, Year: %d\n", item.IMDBID(), item.Year())
}

MovieSearchOptions fields:

  • Query - Free text search
  • IMDBID - IMDB ID (with or without 'tt' prefix)
  • TMDBID - The Movie Database ID
  • Genre - Genre filter
  • Year - Release year
  • Category, Limit, Offset, Extended

Search for music with artist/album support:

results, err := client.MusicSearch(jackett.MusicSearchOptions{
    Artist:   "Pink Floyd",
    Album:    "Dark Side of the Moon",
    Year:     "1973",
    Category: jackett.CategoryAudioLossless,
})

items := results.ToTorznabItems()
for _, item := range items {
    fmt.Printf("%s by %s\n", item.Album(), item.Artist())
}

MusicSearchOptions fields:

  • Query - Free text search
  • Artist - Artist name
  • Album - Album name
  • Label - Record label
  • Track - Track name
  • Year - Release year
  • Genre - Genre filter
  • Category, Limit, Offset, Extended

Search for books with author/title support:

results, err := client.BookSearch(jackett.BookSearchOptions{
    Author: "Isaac Asimov",
    Title:  "Foundation",
    Category: jackett.CategoryBooksEBook,
})

items := results.ToTorznabItems()
for _, item := range items {
    fmt.Printf("%s by %s\n", item.BookTitle(), item.Author())
}

BookSearchOptions fields:

  • Query - Free text search
  • Author - Author name
  • Title - Book title
  • Year - Publication year
  • Category, Limit, Offset, Extended

Torznab Attribute Helpers

The TorznabItem type provides convenient methods to access torznab extended attributes:

items := results.ToTorznabItems()
for _, item := range items {
    // Torrent health
    fmt.Printf("Seeders: %d\n", item.Seeders())
    fmt.Printf("Leechers: %d\n", item.Leechers())
    fmt.Printf("Peers: %d\n", item.Peers())
    
    // Torrent identifiers
    fmt.Printf("InfoHash: %s\n", item.InfoHash())
    fmt.Printf("Magnet: %s\n", item.MagnetURL())
    
    // Freeleech detection
    if item.IsFreeleech() {
        fmt.Println("This is freeleech!")
    }
    fmt.Printf("Download factor: %.1f\n", item.DownloadVolumeFactor())
    fmt.Printf("Upload factor: %.1f\n", item.UploadVolumeFactor())
    
    // TV show attributes
    fmt.Printf("TVDB ID: %s\n", item.TVDBID())
    fmt.Printf("Season %d Episode %d\n", item.Season(), item.Episode())
    
    // Movie attributes
    fmt.Printf("IMDB: %s\n", item.IMDBID())
    fmt.Printf("TMDB: %s\n", item.TMDBID())
    
    // Media quality
    fmt.Printf("Resolution: %s\n", item.Resolution())
    fmt.Printf("Video: %s\n", item.Video())
    fmt.Printf("Audio: %s\n", item.Audio())
    
    // Categories and tags
    fmt.Printf("Categories: %v\n", item.Categories())
    fmt.Printf("Tags: %v\n", item.Tags())
    if item.HasTag("internal") {
        fmt.Println("Internal release")
    }
}

Category Constants

The library provides constants for all standard torznab categories:

// TV
jackett.CategoryTV, jackett.CategoryTVHD, jackett.CategoryTVSD, 
jackett.CategoryTVUHD, jackett.CategoryTVAnime

// Movies
jackett.CategoryMovies, jackett.CategoryMoviesHD, jackett.CategoryMoviesSD,
jackett.CategoryMoviesUHD, jackett.CategoryMoviesBluRay

// Music
jackett.CategoryAudio, jackett.CategoryAudioMP3, jackett.CategoryAudioLossless,
jackett.CategoryAudioAudiobook

// Books
jackett.CategoryBooks, jackett.CategoryBooksEBook, jackett.CategoryBooksComics

// And many more - see constants.go

Methods

Jackett Proxy Methods
  • GetIndexers() / GetIndexersCtx() - Get configured indexers
  • GetTorrents(indexer, opts) / GetTorrentsCtx() - Search torrents via Jackett
  • GetEnclosure(url) / GetEnclosureCtx() - Download torrent file
Direct Tracker Methods
  • SearchDirect(query, opts) / SearchDirectCtx() - Generic search on tracker
  • GetCapsDirect() / GetCapsDirectCtx() - Get tracker capabilities
Specialized Search Methods (work in both modes)
  • TVSearch(opts) / TVSearchCtx() - TV show search with TVDB/TVMaze support
  • MovieSearch(opts) / MovieSearchCtx() - Movie search with IMDB/TMDB support
  • MusicSearch(opts) / MusicSearchCtx() - Music search with artist/album support
  • BookSearch(opts) / BookSearchCtx() - Book search with author/title support

Improvements

This library implements best practices for HTTP client usage:

  1. Drain-and-Close Pattern: All HTTP response bodies are properly drained before closing to ensure connection reuse and prevent resource leaks
  2. Direct Tracker Support: Bypass Jackett and query tracker torznab APIs directly for better performance and reliability
  3. Context Support: All methods support context for proper timeout and cancellation handling

License

See LICENSE file.

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 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