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 ¶
Types ¶
type FlexInt ¶
type FlexInt int
FlexInt unmarshals both string and number JSON representations to an int. SubSource's releaseYear field returns either shape; errors default to zero (unknown year).
func (*FlexInt) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler for FlexInt.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the SubSource API client.
func (*Provider) CheckCredentials ¶ added in v0.6.0
CheckCredentials reports whether SubSource accepts the configured API key.
The verdict is the STATUS, and the body is never read. Measured 2026-09-19: the key gate runs ahead of routing (an unregistered path answers 401 with `{"error":"Invalid API key"}` just as a real one does), so any answer that is not 401 or 403 means the key was accepted whatever the router then made of the request. A 5xx is the one arm that cannot say either way, so it reports as an incomplete check rather than as a verdict.
func (*Provider) Download ¶
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() subflux.ProviderID
Name returns the provider identifier for SubSource.