jackett

package module
v0.0.0-...-5f963f0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 14 Imported by: 0

README

go-jackett

Go library for communicating with jackett.

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg Config) *Client

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)

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
}

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 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"`
}

Jump to

Keyboard shortcuts

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