Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpisodeDetails ¶
type EpisodeDetails struct {
// "ID" of the extension.
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 {
// "ID" of the extension.
Provider string `json:"provider"`
// Episode server name.
// e.g. "vidcloud".
Server string `json:"server"`
// 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(opts SearchOptions) ([]*SearchResult, error)
// FindEpisodes returns the episodes for the given anime ID.
FindEpisodes(id string) ([]*EpisodeDetails, error)
// FindEpisodeServer returns the episode server for the given episode.
// The "server" argument can be "default"
FindEpisodeServer(episode *EpisodeDetails, server string) (*EpisodeServer, error)
// GetSettings returns the provider settings.
GetSettings() Settings
}
type SearchOptions ¶ added in v0.5.0
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" )
Click to show internal directories.
Click to hide internal directories.