providers

package
v0.1.119 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SortMovies ...
	SortMovies = iota
	// SortShows ...
	SortShows
)
View Source
const (
	// SortBySeeders ...
	SortBySeeders = iota
	// SortByResolution ...
	SortByResolution
	// SortBalanced ...
	SortBalanced
	// SortBySize ...
	SortBySize
)
View Source
const (
	// Sort1080p720p480p ...
	Sort1080p720p480p = iota
	// Sort720p1080p480p ...
	Sort720p1080p480p
	// Sort720p480p1080p ...
	Sort720p480p1080p
	// Sort480p720p1080p ...
	Sort480p720p1080p
)

Variables

This section is empty.

Functions

func Balanced

func Balanced(t *bittorrent.TorrentFile) float64

Balanced ...

func CallbackHandler

func CallbackHandler(ctx *gin.Context)

CallbackHandler ...

func GetCallback

func GetCallback() (string, chan []byte)

GetCallback ...

func NormalizeTitle

func NormalizeTitle(title string) string

NormalizeTitle ...

func QualityFactor

func QualityFactor(t *bittorrent.TorrentFile) float64

QualityFactor ...

func RemoveCallback

func RemoveCallback(cid string)

RemoveCallback ...

func RemoveTrailingApostrophe

func RemoveTrailingApostrophe(str string) string

RemoveTrailingApostrophe ...

func RemoveTrailingApostrophes

func RemoveTrailingApostrophes(str string) string

RemoveTrailingApostrophes ...

func Resolution720p480p

func Resolution720p480p(t *bittorrent.TorrentFile) int

Resolution720p480p ...

func Resolution720p1080p

func Resolution720p1080p(t *bittorrent.TorrentFile) int

Resolution720p1080p ...

func RomanizeHepburn

func RomanizeHepburn(str string) string

RomanizeHepburn ... as per http://en.wikipedia.org/wiki/Hepburn_romanization#Variations

func Search(xbmcHost *xbmc.XBMCHost, searchers []Searcher, query string) []*bittorrent.TorrentFile

Search ...

func SearchEpisode

func SearchEpisode(xbmcHost *xbmc.XBMCHost, searchers []EpisodeSearcher, show *tmdb.Show, season *tmdb.Season, episode *tmdb.Episode) []*bittorrent.TorrentFile

SearchEpisode ...

func SearchMovie

func SearchMovie(xbmcHost *xbmc.XBMCHost, searchers []MovieSearcher, movie *tmdb.Movie) []*bittorrent.TorrentFile

SearchMovie ...

func SearchMovieSilent

func SearchMovieSilent(xbmcHost *xbmc.XBMCHost, searchers []MovieSearcher, movie *tmdb.Movie, withAuth bool) []*bittorrent.TorrentFile

SearchMovieSilent ...

func SearchSeason

func SearchSeason(xbmcHost *xbmc.XBMCHost, searchers []SeasonSearcher, show *tmdb.Show, season *tmdb.Season) []*bittorrent.TorrentFile

SearchSeason ...

func SearchTimeout added in v0.1.119

func SearchTimeout() time.Duration

SearchTimeout is how long providers are waited for

Types

type AddonSearcher

type AddonSearcher struct {
	MovieSearcher
	SeasonSearcher
	EpisodeSearcher
	// contains filtered or unexported fields
}

AddonSearcher ...

func NewAddonSearcher

func NewAddonSearcher(xbmcHost *xbmc.XBMCHost, callbackHost string, addonID string) *AddonSearcher

NewAddonSearcher ...

func (*AddonSearcher) GetEpisodeSearchObject

func (as *AddonSearcher) GetEpisodeSearchObject(show *tmdb.Show, season *tmdb.Season, episode *tmdb.Episode) *EpisodeSearchObject

GetEpisodeSearchObject ...

func (*AddonSearcher) GetMovieSearchObject

func (as *AddonSearcher) GetMovieSearchObject(movie *tmdb.Movie) *MovieSearchObject

GetMovieSearchObject ...

func (*AddonSearcher) GetMovieSearchSilentObject

func (as *AddonSearcher) GetMovieSearchSilentObject(movie *tmdb.Movie, withAuth bool) *MovieSearchObject

GetMovieSearchSilentObject ...

func (*AddonSearcher) GetQuerySearchObject

func (as *AddonSearcher) GetQuerySearchObject(query string) *QuerySearchObject

GetQuerySearchObject ...

func (*AddonSearcher) GetSeasonSearchObject

func (as *AddonSearcher) GetSeasonSearchObject(show *tmdb.Show, season *tmdb.Season) *SeasonSearchObject

GetSeasonSearchObject ...

func (as *AddonSearcher) SearchEpisodeLinks(show *tmdb.Show, season *tmdb.Season, episode *tmdb.Episode) []*bittorrent.TorrentFile

SearchEpisodeLinks ...

func (as *AddonSearcher) SearchLinks(query string) []*bittorrent.TorrentFile

SearchLinks ...

func (as *AddonSearcher) SearchMovieLinks(movie *tmdb.Movie) []*bittorrent.TorrentFile

SearchMovieLinks ...

func (*AddonSearcher) SearchMovieLinksSilent

func (as *AddonSearcher) SearchMovieLinksSilent(movie *tmdb.Movie, withAuth bool) []*bittorrent.TorrentFile

SearchMovieLinksSilent ...

func (as *AddonSearcher) SearchSeasonLinks(show *tmdb.Show, season *tmdb.Season) []*bittorrent.TorrentFile

SearchSeasonLinks ...

type Diagnosis added in v0.1.119

type Diagnosis struct {
	AddonID    string
	Payload    SearchObject
	Responded  bool
	Elapsed    time.Duration
	ParseError error
	Results    []*Result
	Usable     int
	Problems   []*Problem
	Requests   []proxy.RecordedRequest
}

Diagnosis is a result of a test search, made by a single provider

func Diagnose added in v0.1.119

func Diagnose(xbmcHost *xbmc.XBMCHost, callbackHost, addonID, method string, build func(*AddonSearcher) SearchObject) *Diagnosis

Diagnose runs a test search with a provider and checks what it returns. Requests, made by provider through internal proxy, are recorded by a tag in proxy URL.

type EpisodeSearchObject

type EpisodeSearchObject struct {
	GeneralSearchObject
	IMDBId         string            `json:"imdb_id"`
	TVDBId         int               `json:"tvdb_id"`
	TMDBId         int               `json:"tmdb_id"`
	ShowTMDBId     int               `json:"show_tmdb_id"`
	Title          string            `json:"title"`
	Season         int               `json:"season"`
	SeasonName     string            `json:"season_name"`
	Episode        int               `json:"episode"`
	Year           int               `json:"year"`
	SeasonYear     int               `json:"season_year"`
	ShowYear       int               `json:"show_year"`
	Titles         map[string]string `json:"titles"`
	AbsoluteNumber int               `json:"absolute_number"`
	Anime          bool              `json:"anime"`
}

EpisodeSearchObject ...

type EpisodeSearcher

type EpisodeSearcher interface {
	SearchEpisodeLinks(show *tmdb.Show, season *tmdb.Season, episode *tmdb.Episode) []*bittorrent.TorrentFile
}

EpisodeSearcher ...

func GetEpisodeSearchers

func GetEpisodeSearchers(xbmcHost *xbmc.XBMCHost, callbackHost string) []EpisodeSearcher

GetEpisodeSearchers ...

type GeneralSearchObject

type GeneralSearchObject struct {
	ProxyURL         string `json:"proxy_url"`
	InternalProxyURL string `json:"internal_proxy_url"`
	ElementumURL     string `json:"elementum_url"`

	Silent   bool `json:"silent"`
	SkipAuth bool `json:"skip_auth"`
}

GeneralSearchObject ...

func (*GeneralSearchObject) General added in v0.1.119

General returns common fields of a search object

type MovieSearchObject

type MovieSearchObject struct {
	GeneralSearchObject
	IMDBId string            `json:"imdb_id"`
	TMDBId int               `json:"tmdb_id"`
	Title  string            `json:"title"`
	Year   int               `json:"year"`
	Years  map[string]int    `json:"years"`
	Titles map[string]string `json:"titles"`
}

MovieSearchObject ...

type MovieSearcher

type MovieSearcher interface {
	SearchMovieLinks(movie *tmdb.Movie) []*bittorrent.TorrentFile
	SearchMovieLinksSilent(movie *tmdb.Movie, withAuth bool) []*bittorrent.TorrentFile
}

MovieSearcher ...

func GetMovieSearchers

func GetMovieSearchers(xbmcHost *xbmc.XBMCHost, callbackHost string) []MovieSearcher

GetMovieSearchers ...

type MultiSorter

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

MultiSorter ...

func SortBy

func SortBy(less ...lessFunc) *MultiSorter

SortBy ...

func (*MultiSorter) Sort

func (ms *MultiSorter) Sort(torrents []*bittorrent.TorrentFile)

Sort ...

type Problem added in v0.1.119

type Problem struct {
	Text    string
	Count   int
	Example string
}

Problem is an issue found in provider results

type QuerySearchObject

type QuerySearchObject struct {
	GeneralSearchObject
	Query string `json:"query"`
}

QuerySearchObject ...

type Result added in v0.1.119

type Result struct {
	Name     string
	URI      string
	Size     string
	Provider string
	Seeds    int64
	Peers    int64
	// Problem is empty when Elementum can use the result
	Problem string
}

Result is a copy of what provider returned, taken before resolving, with a problem found in it

type SearchObject added in v0.1.119

type SearchObject interface {
	General() *GeneralSearchObject
}

SearchObject is any of search objects, sent to providers

type SearchPayload

type SearchPayload struct {
	Method           string `json:"method"`
	CallbackURL      string `json:"callback_url"`
	CallbackLogin    string `json:"callback_login"`
	CallbackPassword string `json:"callback_password"`
	SearchObject     any    `json:"search_object"`
}

SearchPayload ...

func (*SearchPayload) String

func (sp *SearchPayload) String() string

type Searcher

type Searcher interface {
	SearchLinks(query string) []*bittorrent.TorrentFile
}

Searcher ...

func GetSearchers

func GetSearchers(xbmcHost *xbmc.XBMCHost, callbackHost string) []Searcher

GetSearchers ...

type SeasonSearchObject

type SeasonSearchObject struct {
	GeneralSearchObject
	IMDBId     string            `json:"imdb_id"`
	TVDBId     int               `json:"tvdb_id"`
	TMDBId     int               `json:"tmdb_id"`
	ShowTMDBId int               `json:"show_tmdb_id"`
	Title      string            `json:"title"`
	Season     int               `json:"season"`
	Year       int               `json:"year"`
	Titles     map[string]string `json:"titles"`
	Anime      bool              `json:"anime"`
}

SeasonSearchObject ...

type SeasonSearcher

type SeasonSearcher interface {
	SearchSeasonLinks(show *tmdb.Show, season *tmdb.Season) []*bittorrent.TorrentFile
}

SeasonSearcher ...

func GetSeasonSearchers

func GetSeasonSearchers(xbmcHost *xbmc.XBMCHost, callbackHost string) []SeasonSearcher

GetSeasonSearchers ...

Jump to

Keyboard shortcuts

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