Documentation
¶
Index ¶
- Constants
- Variables
- type AudioLanguage
- type ContentType
- type Dash
- type Media
- func (m *Media) EpisodeStream(episodeId, audioLanguage string, player PlayerType, quality VideoQuality) (*StreamData, error)
- func (m *Media) MovieStream(audioLanguage string, player PlayerType, quality VideoQuality) (*StreamData, error)
- func (m *Media) ParseURL(rawLink string) error
- func (m *Media) RequestMovie() (*VideoItem, error)
- func (m *Media) RequestSeason(seasonId string) (*SeasonData, error)
- func (m *Media) RequestTvShow() (*TvShowData, error)
- type PlayerType
- type SeasonData
- type Stream
- type StreamData
- type StreamRequestPayload
- type TvShowData
- type VideoItem
- type VideoQuality
- type ViewOptions
Constants ¶
View Source
const DeviceID = "atvui40"
DeviceID is the default identifier used for requests.
Variables ¶
View Source
var Player = struct { PlayReady PlayerType Widevine PlayerType }{ PlayReady: DeviceID + ":DASH-CENC:PR", Widevine: DeviceID + ":DASH-CENC:WVM", }
View Source
var Quality = struct { FHD VideoQuality HD VideoQuality }{ FHD: "FHD", HD: "HD", }
Functions ¶
This section is empty.
Types ¶
type AudioLanguage ¶
type AudioLanguage struct {
Id string `json:"id"`
}
type ContentType ¶
type ContentType string
ContentType defines the type of media.
const ( MovieType ContentType = "movies" TvShowType ContentType = "tv_shows" )
type Media ¶
type Media struct {
Id string // Matches "content_id" or "tv_show_id" in URLs
MarketCode string
Type ContentType
}
Media represents a piece of content, which can be a Movie or a TV Show.
func (*Media) EpisodeStream ¶
func (m *Media) EpisodeStream(episodeId, audioLanguage string, player PlayerType, quality VideoQuality) (*StreamData, error)
EpisodeStream requests the stream for a specific TV Show Episode (POST).
func (*Media) MovieStream ¶
func (m *Media) MovieStream(audioLanguage string, player PlayerType, quality VideoQuality) (*StreamData, error)
MovieStream requests the stream for this movie (POST). The movie's own ID is used as the contentId.
func (*Media) RequestMovie ¶
RequestMovie fetches movie details (GET).
func (*Media) RequestSeason ¶
func (m *Media) RequestSeason(seasonId string) (*SeasonData, error)
RequestSeason fetches episodes for a specific season (GET). This method is only applicable to TV Shows.
func (*Media) RequestTvShow ¶
func (m *Media) RequestTvShow() (*TvShowData, error)
RequestTvShow fetches TV show details like seasons (GET).
type SeasonData ¶
type SeasonData struct {
Episodes []VideoItem `json:"episodes"`
}
type Stream ¶
type Stream struct {
AudioLanguages []AudioLanguage `json:"audio_languages"`
}
type StreamData ¶
type StreamData struct {
StreamInfos []struct {
LicenseUrl string `json:"license_url"`
Url string `json:"url"`
} `json:"stream_infos"`
}
func (StreamData) Dash ¶
func (s StreamData) Dash() (*Dash, error)
type StreamRequestPayload ¶
type StreamRequestPayload struct {
AudioQuality string `json:"audio_quality"`
DeviceIdentifier string `json:"device_identifier"`
DeviceSerial string `json:"device_serial"`
SubtitleLanguage string `json:"subtitle_language"`
VideoType string `json:"video_type"`
Player PlayerType `json:"player"`
ClassificationId int `json:"classification_id"`
ContentType string `json:"content_type"`
DeviceStreamVideoQuality VideoQuality `json:"device_stream_video_quality"`
AudioLanguage string `json:"audio_language"`
ContentId string `json:"content_id"`
}
type TvShowData ¶
type TvShowData struct {
Seasons []struct {
Id string `json:"id"`
} `json:"seasons"`
}
func (TvShowData) String ¶
func (t TvShowData) String() string
type VideoItem ¶
type VideoItem struct {
Title string `json:"title"`
Id string `json:"id"`
ViewOptions ViewOptions `json:"view_options"`
}
type VideoQuality ¶
type VideoQuality string
VideoQuality defines the allowed video qualities for streaming.
type ViewOptions ¶
type ViewOptions struct {
Private struct {
Streams []Stream `json:"streams"`
} `json:"private"`
}
Click to show internal directories.
Click to hide internal directories.