Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anime ¶
type Anime struct {
Name string
URL string
Cover string
Year int
Genres []string
Status string
MALID int // MyAnimeList ID for metadata linkage
AniListID int // AniList ID for metadata linkage
AllAnimeID string // AllAnime show ID for episode/streams
EpisodeCount int // Total episode count
Type string // "TV", "Movie", "OVA", etc.
Rating string // "PG-13 - Teens 13 or older"
Score float64
Rank int
Popularity int
Source Source
}
Anime represents a single anime title with its metadata from providers like Jikan/AniList. It serves as the central data model passed between search, episode listing, and stream resolution.
type Episode ¶
type Episode struct {
Number float64
Title string
URL string
Season int // 0 = no season (single season anime)
Anime *Anime
}
Episode represents a single episode within an anime season. It links back to its parent Anime for context during stream resolution.
type Season ¶
Season represents a single season of an anime, used to organize episodes when an anime has multiple cours or parts (e.g., "Season 2 - Cour 1").
type Source ¶
type Source interface {
// Name returns the human-readable provider name (e.g., "Jikan", "AllAnime").
Name() string
// Search queries the provider for anime matching the given string.
Search(query string) ([]*Anime, error)
// SeasonsOf returns available seasons for an anime, enabling multi-season navigation.
SeasonsOf(anime *Anime) ([]Season, error)
// EpisodesOf returns episodes for a specific season of an anime.
EpisodesOf(anime *Anime, season int) ([]*Episode, error)
// StreamsOf resolves playable stream URLs for a given episode.
StreamsOf(episode *Episode) ([]*Stream, error)
// ID returns the unique provider identifier used in config and registration.
ID() string
}
Source is the core abstraction for all anime data providers (Jikan, AllAnime, AniList). It defines the contract for searching anime, listing seasons/episodes, and resolving streams. This interface decouples the TUI/CLI from specific provider implementations.
type Stream ¶
type Stream struct {
Quality string
URL string
Provider string
Referer string // Required for some providers
Subtitles []Subtitle
NeedsReferrer bool // True if stream requires Referer header to play
}
Stream represents a single playable video source for an episode. Each stream has a quality level, direct URL, and the provider it came from. The Referer field is required by some CDN providers to authorize playback.