const Markets = "amer apac emea latam"
APIError represents a single error object from the Max API
type APIError struct { Code string `json:"code"` Detail string `json:"detail"` }
APIErrors represents a collection of API errors and implements the error interface
type APIErrors []APIError
func (e APIErrors) Error() string
type Cookie struct { Name string Value string }
func StRequest() (*Cookie, error)
func (*Cookie) CachePath() string
func (c *Cookie) String() string
Entity represents a single unified node in the Max API response
type Entity struct { Attributes struct { Name string Alias string ShowType string VideoType string MaterialType string Description string SeasonNumber int EpisodeNumber int AirDate string } Id string Relationships struct { Edit struct { Data Resource } Items struct { Data []Resource } Show struct { Data Resource } Video struct { Data Resource } } Type string }
func MovieRequest(token, movieId string) ([]*Entity, error)
func MovieResults(entities []*Entity) []*Entity
func SearchRequest(token, query string) ([]*Entity, error)
func SearchResults(entities []*Entity) ([]*Entity, error)
func SeasonRequest(token, showId string, seasonNumber int) ([]*Entity, error)
func SeasonResults(entities []*Entity) []*Entity
func (e *Entity) String() string
String implements the fmt.Stringer interface to provide a clean visual output for the Entity
type Initiate struct { LinkingCode string TargetUrl string }
func InitiateRequest(st *Cookie, market string) (*Initiate, error)
func (i *Initiate) String() string
type Login struct { Token string }
func LoginRequest(st *Cookie) (*Login, error)
you must /authentication/linkDevice/initiate first or this will always fail
func (*Login) CachePath() string
type Playback struct { Drm struct { Schemes struct { PlayReady *Scheme Widevine *Scheme } } Errors APIErrors `json:"errors"` Fallback struct { Manifest struct { Url string // _fallback.mpd:1080p, .mpd:4K } } Manifest struct { Url string // 1080p } }
func PlayReadyRequest(token, editId string) (*Playback, error)
func WidevineRequest(token, editId string) (*Playback, error)
func (*Playback) CachePath() string
func (p *Playback) GetManifest() (*url.URL, error)
func (p *Playback) PlayReadyRequest(body []byte) ([]byte, error)
SL2000 max 1080p SL3000 max 2160p
func (p *Playback) WidevineRequest(body []byte) ([]byte, error)
Resource represents a relationship pointer in the JSON:API graph
type Resource struct { Id string Type string }
type Scheme struct { LicenseUrl string }