Documentation
¶
Index ¶
- type APIEpisode
- type Client
- func (c *Client) GetInfo(ctx context.Context, mediaType, provider, id string) (*InfoResponse, error)
- func (c *Client) GetMangaPages(ctx context.Context, mediaType, provider, chapterID string) (*MangaPagesResponse, error)
- func (c *Client) GetServers(ctx context.Context, mediaType, provider, episodeID string) ([]Server, error)
- func (c *Client) GetSources(ctx context.Context, mediaType, provider, episodeID string) (*SourcesResponse, error)
- func (c *Client) GetSourcesWithMediaID(ctx context.Context, mediaType, provider, episodeID, mediaID string) (*SourcesResponse, error)
- func (c *Client) GetSourcesWithParams(ctx context.Context, mediaType, provider, episodeID string, ...) (*SourcesResponse, error)
- func (c *Client) HealthCheck(ctx context.Context, provider, mediaType string) error
- func (c *Client) Search(ctx context.Context, mediaType, provider, query string) (*SearchResponse, error)
- type ErrorResponse
- type InfoCache
- type InfoResponse
- type MangaChapter
- type MangaPage
- type MangaPagesResponse
- type SearchResponse
- type SearchResult
- type Server
- type Source
- type SourceHeaders
- type SourcesResponse
- type Subtitle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIEpisode ¶
type APIEpisode struct {
ID string `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
URL string `json:"url,omitempty"` // Contains mediaID for some providers (e.g., SFlix)
Season int `json:"season,omitempty"` // Some providers include season info
}
APIEpisode represents an episode in the API response
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles communication with the streaming API server
func (*Client) GetInfo ¶
func (c *Client) GetInfo(ctx context.Context, mediaType, provider, id string) (*InfoResponse, error)
GetInfo retrieves detailed information about a media item
func (*Client) GetMangaPages ¶
func (c *Client) GetMangaPages(ctx context.Context, mediaType, provider, chapterID string) (*MangaPagesResponse, error)
GetMangaPages retrieves pages for a manga chapter
func (*Client) GetServers ¶
func (c *Client) GetServers(ctx context.Context, mediaType, provider, episodeID string) ([]Server, error)
GetServers retrieves available streaming servers for an episode This is optional - not all providers use it
func (*Client) GetSources ¶
func (c *Client) GetSources(ctx context.Context, mediaType, provider, episodeID string) (*SourcesResponse, error)
GetSources retrieves video sources for an episode
func (*Client) GetSourcesWithMediaID ¶
func (c *Client) GetSourcesWithMediaID(ctx context.Context, mediaType, provider, episodeID, mediaID string) (*SourcesResponse, error)
GetSourcesWithMediaID retrieves video sources for an episode with optional mediaID
func (*Client) GetSourcesWithParams ¶
func (c *Client) GetSourcesWithParams(ctx context.Context, mediaType, provider, episodeID string, params map[string]string) (*SourcesResponse, error)
GetSourcesWithParams retrieves video sources with custom parameters (for HiAnime server/category)
func (*Client) HealthCheck ¶
HealthCheck checks if a provider is available
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse represents an API error response
type InfoCache ¶
type InfoCache struct {
// contains filtered or unexported fields
}
InfoCache caches media info responses to avoid redundant API calls
func (*InfoCache) Get ¶
func (c *InfoCache) Get(key string) (*InfoResponse, bool)
Get retrieves a cached response
func (*InfoCache) Set ¶
func (c *InfoCache) Set(key string, val *InfoResponse)
Set stores a response in the cache
type InfoResponse ¶
type InfoResponse struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url"`
Image string `json:"image"`
Description string `json:"description"`
Genres []string `json:"genres"`
Status string `json:"status"`
TotalEpisodes int `json:"totalEpisodes"`
Episodes []APIEpisode `json:"episodes"`
Chapters []MangaChapter `json:"chapters,omitempty"` // For manga providers
ReleaseDate string `json:"releaseDate,omitempty"`
Rating string `json:"rating,omitempty"` // IMDB rating (e.g., "7.5")
Type string `json:"type,omitempty"` // For movies: "Movie" or "TV Series"
LastSeason int `json:"lastSeason,omitempty"` // For TV shows: last season number
}
InfoResponse represents the API's info/details response
type MangaChapter ¶
type MangaChapter struct {
ID string `json:"id"`
Number string `json:"number"` // Can be "1", "1.5", etc.
Title string `json:"title"`
}
MangaChapter represents a manga chapter in the API response
type MangaPagesResponse ¶
type MangaPagesResponse struct {
Pages []MangaPage `json:"pages"`
}
MangaPagesResponse represents the API's manga pages response
type SearchResponse ¶
type SearchResponse struct {
Results []SearchResult `json:"results"`
}
SearchResponse represents the API's search response
type SearchResult ¶
type SearchResult struct {
ID string `json:"id"`
Title string `json:"title"`
Image string `json:"image"`
URL string `json:"url"` // Can contain type info (e.g., /movie/ or /tv/)
ReleaseDate string `json:"releaseDate"` // Release date from API (YYYY-MM-DD format)
Type string `json:"type"` // "Movie" or "TV Series"
}
SearchResult represents a single search result from the API
type Source ¶
type Source struct {
URL string `json:"url"`
Quality string `json:"quality"`
IsM3U8 bool `json:"isM3U8"`
Referer string `json:"referer,omitempty"` // Optional referer from source (HiAnime)
Origin string `json:"origin,omitempty"` // Optional origin from source
}
Source represents a video source
type SourceHeaders ¶
type SourceHeaders struct {
Referer string `json:"Referer,omitempty"`
Origin string `json:"Origin,omitempty"`
}
SourceHeaders contains headers required for video playback
type SourcesResponse ¶
type SourcesResponse struct {
Sources []Source `json:"sources"`
Subtitles []Subtitle `json:"subtitles"`
Headers *SourceHeaders `json:"headers,omitempty"`
}
SourcesResponse represents the API's sources response