Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpisodeDetails ¶
type EpisodeDetails struct { // Provider is the ID of the provider. // This should be the same as the extension ID and follow the same format. Provider string `json:"provider"` // ID is the episode slug. // e.g. "the-apothecary-diaries-18578". ID string `json:"id"` // Episode number. // From 0 to n. Number int `json:"number"` // Episode page URL. URL string `json:"url"` // Episode title. // Leave it empty if the episode title is not available. Title string `json:"title,omitempty"` }
EpisodeDetails contains the episode information from a provider. It is obtained by scraping the list of episodes.
type EpisodeServer ¶
type EpisodeServer struct { // Provider is the ID of the provider. // This should be the same as the extension ID and follow the same format. Provider string `json:"provider"` // Server is the video server name. // e.g. "vidcloud". Server string `json:"server"` // Headers are the HTTP headers for the video request. Headers map[string]string `json:"headers"` // Video sources for the episode. VideoSources []*VideoSource `json:"videoSources"` }
EpisodeServer contains the server, headers and video sources for an episode.
type Provider ¶
type Provider interface { Search(query string, dub bool) ([]*SearchResult, error) // FindEpisode returns the episode details for the given anime ID. // The ID is the anime slug. FindEpisode(id string) ([]*EpisodeDetails, error) // FindEpisodeServer returns the episode server for the given episode. // "server" can be "default" FindEpisodeServer(episode *EpisodeDetails, server string) (*EpisodeServer, error) // GetEpisodeServers returns the list of servers from the provider. GetEpisodeServers() []string }
type SearchResult ¶
type VideoExtractor ¶
type VideoExtractor interface {
Extract(uri string) ([]*VideoSource, error)
}
type VideoSource ¶
type VideoSource struct { // URL of the video source. URL string `json:"url"` // Type of the video source. Type VideoSourceType `json:"type"` // Quality of the video source. // e.g. "default", "auto", "1080p". Quality string `json:"quality"` // Subtitles for the video source. Subtitles []*VideoSubtitle `json:"subtitles"` }
type VideoSourceType ¶
type VideoSourceType string
const ( VideoSourceMP4 VideoSourceType = "mp4" VideoSourceM3U8 VideoSourceType = "m3u8" VideoSourceDash VideoSourceType = "dash" )
Click to show internal directories.
Click to hide internal directories.