Documentation
¶
Overview ¶
Package stremio searches Stremio stream addons for torrent releases.
A stream addon answers GET {base}/stream/{type}/{id}.json with streams for an IMDb title (type "movie", id "tt0816692") or episode (type "series", id "tt0903747:1:2"). Ether reads each stream's info hash, file name, size, seeders and any debrid cached marker, and streams the torrent through the owner's own debrid accounts; it never calls an addon's playback links. Ether ships no addon URLs: the owner pastes the install URL of an addon they chose, with or without the addon's own settings.
Index ¶
- func BaseURL(raw string) (*url.URL, error)
- type AnimeIDs
- type Backend
- func (b *Backend) FetchNZB(ctx context.Context, r core.Release, ...) ([]byte, error)
- func (b *Backend) ResolveTorrent(_ context.Context, r core.Release, _ func(context.Context, string) error) (core.Release, error)
- func (b *Backend) Search(ctx context.Context, req core.SearchRequest, ...) ([]core.Release, error)
- type Manifest
- type Options
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnimeIDs ¶ added in v0.2.44
type AnimeIDs interface {
Lookup(ctx context.Context, req core.SearchRequest, db string) (id int64, episode int, ok bool, err error)
}
AnimeIDs maps a TMDB request to an anime database id (Kitsu, MAL, AniList, AniDB) for addons that look anime up only by those ids. Implemented by *animemap.Service.
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a newznab.Backend for one Stremio addon: the indexer Client keeps budgets, the result cache, rate-limit pauses and events around it.
func (*Backend) FetchNZB ¶
func (b *Backend) FetchNZB(ctx context.Context, r core.Release, reserve func(context.Context, string) error) ([]byte, error)
FetchNZB implements newznab.Backend for an addon's Usenet streams: it downloads the stream's NZB. The addon's own origin is trusted (a self-hosted addon on the LAN); any other host, and every redirect hop, must be public. Errors name the host only. Whatever the server answers is transient (core.ErrSourceUnavailable): a login page or an oversized body today says nothing permanent about the release. Only a release without a usable NZB link is rejected (core.ErrReleaseRejected).
func (*Backend) ResolveTorrent ¶
func (b *Backend) ResolveTorrent(_ context.Context, r core.Release, _ func(context.Context, string) error) (core.Release, error)
ResolveTorrent implements newznab.Backend. Every addon result already carries its info hash and magnet.
func (*Backend) Search ¶
func (b *Backend) Search(ctx context.Context, req core.SearchRequest, reserve func(context.Context, string) error) ([]core.Release, error)
Search implements newznab.Backend. Movies are looked up by id and episodes by id, season and episode (lookupID: IMDb, else TMDB, else a mapped anime database id); a season-level request (Episode 0) asks for the season's first episode and keeps whole-season packs. Titles the addon cannot be asked about, and show-level requests, have no answer.
type Manifest ¶
type Manifest struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Types []string `json:"types"`
IDPrefixes []string `json:"idPrefixes"`
Resources []json.RawMessage `json:"resources"`
BehaviorHints struct {
ConfigurationRequired bool `json:"configurationRequired"`
} `json:"behaviorHints"`
}
Manifest is the part of an addon manifest Ether reads.
func FetchManifest ¶
FetchManifest reads and checks the manifest of the addon at rawURL.
type Options ¶ added in v0.2.44
type Options struct {
// Client talks to the owner-configured addon (20 s timeout when nil).
Client *http.Client
// NZBClient downloads the NZB files of Usenet streams. Its transport
// must be a safefetch guard: only the addon's own origin may be a
// private address. Nil builds one.
NZBClient *http.Client
// Anime maps TMDB ids to anime database ids; nil loads the community
// mapping lazily, the first time an addon needs it.
Anime AnimeIDs
}
Options configure a Service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service builds and keeps one Backend per configured addon, so a backend's manifest survives between searches.
func NewService ¶
NewService returns a Service. client nil uses a default client with a 20 s timeout.
func NewServiceWithOptions ¶ added in v0.2.44
NewServiceWithOptions returns a Service built from o.