subsource

package
v0.1.147 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: GPL-2.0, GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package subsource implements the SubSource subtitle provider. SubSource has a REST API at api.subsource.net. Requires an API key. Supports both movies and TV episodes via IMDB ID search. Rate limits: 60/min, 1800/hour, 7200/day.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(_ context.Context, settings map[string]any) (api.Provider, error)

Factory creates a SubSource provider from settings.

Types

type FlexInt

type FlexInt int

FlexInt is a JSON type that unmarshals both string and number representations to an int value. SubSource's API returns releaseYear as either a string or number. Uses lenient semantics: errors default to zero (year=0 means "unknown").

func (*FlexInt) UnmarshalJSON

func (f *FlexInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for FlexInt.

type Provider

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

Provider implements the SubSource API client.

func (*Provider) Download

func (p *Provider) Download(ctx context.Context, sub *api.Subtitle) ([]byte, error)

Download fetches the subtitle content for the given search result. SubSource returns archives; the subtitle file is extracted automatically.

func (*Provider) Name

func (p *Provider) Name() api.ProviderID

Name returns the provider identifier for SubSource.

func (*Provider) Search

func (p *Provider) Search(ctx context.Context, req *api.SearchRequest) ([]api.Subtitle, error)

Search finds subtitles matching the request via IMDB ID lookup. Tries alternative titles if the primary title is not found.

Jump to

Keyboard shortcuts

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