Help us shape the future of Go! Take the 2026 Go Developer Survey

stremio

package
v0.2.39 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseURL

func BaseURL(raw string) (*url.URL, error)

BaseURL returns an addon's base URL from its install URL: a stremio:// link becomes https://, and a trailing /manifest.json or /configure is removed. The path keeps the addon's settings segment, if any.

Types

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(_ context.Context, r core.Release, _ func(context.Context, string) error) ([]byte, error)

FetchNZB implements newznab.Backend: addon results are torrents.

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 IMDb id and episodes by IMDb id, season and episode; a season-level request (Episode 0) asks for the season's first episode and keeps whole-season packs. Titles without an IMDb id, 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

func FetchManifest(ctx context.Context, client *http.Client, rawURL string) (Manifest, error)

FetchManifest reads and checks the manifest of the addon at rawURL.

func (Manifest) Check

func (m Manifest) Check() error

Check reports why Ether cannot search the addon, or nil.

type Service

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

Service builds and keeps one Backend per addon URL, so a backend's manifest survives between searches.

func NewService

func NewService(client *http.Client) *Service

NewService returns a Service. client nil uses a default client with a 20 s timeout.

func (*Service) Backend

func (s *Service) Backend(cfg config.Indexer) (newznab.Backend, error)

Backend returns the backend for an addon indexer (newznab.Options.Backend).

func (*Service) Test

func (s *Service) Test(ctx context.Context, cfg config.Indexer) error

Test checks that the addon at cfg.URL can be searched.

Jump to

Keyboard shortcuts

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