func License(licenseUrl, bcovAuth string, challenge []byte) ([]byte, error)
AuthData represents the inner payload of authentication responses.
type AuthData struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` }
func Login(guestToken, email, password string) (*AuthData, error)
Login authenticates the user. It requires the guest token (access_token) retrieved from calling the Unauth() function.
func Unauth() (*AuthData, error)
func (*AuthData) CachePath() string
func (a *AuthData) Refresh() error
ContentNode represents the recursive Server-Driven UI tree used by AMC
type ContentNode struct { Type string `json:"type"` Properties *Properties `json:"properties,omitempty"` TabletProperties *Properties `json:"tablet_properties,omitempty"` Children []ContentNode `json:"children,omitempty"` }
func SeasonEpisodes(authToken string, id int) (*ContentNode, error)
func SeriesDetail(authToken string, id int) (*ContentNode, error)
func (c *ContentNode) EpisodesMetadata() []*Metadata
EpisodesMetadata recursively traverses the Server-Driven UI tree and extracts only the Metadata for playable episodes.
func (c *ContentNode) SeasonsMetadata() []*Metadata
SeasonsMetadata recursively traverses the Server-Driven UI tree and extracts only the Metadata for seasons.
type Images struct { Default string `json:"default,omitempty"` Mobile string `json:"mobile,omitempty"` Tablet string `json:"tablet,omitempty"` }
type KeySystems struct { ComWidevineAlpha struct { LicenseURL string `json:"license_url"` } `json:"com.widevine.alpha"` ComMicrosoftPlayready struct { LicenseURL string `json:"license_url"` } `json:"com.microsoft.playready"` }
type Metadata struct { AmcnID string `json:"amcnId,omitempty"` EpisodeNumber int `json:"episodeNumber,omitempty"` ContentNetworkOfRecordID int `json:"contentNetworkOfRecordId,omitempty"` SeasonNumber int `json:"seasonNumber,omitempty"` ShowName string `json:"showName,omitempty"` Title string `json:"title,omitempty"` Nid int `json:"nid,omitempty"` PageType string `json:"pageType,omitempty"` URL string `json:"url,omitempty"` Action string `json:"action,omitempty"` ElementType string `json:"elementType,omitempty"` ClickthroughURL string `json:"clickthroughUrl,omitempty"` ElementName string `json:"elementName,omitempty"` ItemText string `json:"itemText,omitempty"` Label string `json:"label,omitempty"` NavComponentName string `json:"navComponentName,omitempty"` NavigationTitle string `json:"navigationTitle,omitempty"` IsNavigation bool `json:"isNavigation,omitempty"` ListTitle string `json:"listTitle,omitempty"` IsPlayback bool `json:"isPlayback,omitempty"` ListMode string `json:"listMode,omitempty"` SearchValue string `json:"searchValue,omitempty"` ListPosition int `json:"listPosition,omitempty"` ComponentName string `json:"componentName,omitempty"` }
func (m *Metadata) String() string
String implements the fmt.Stringer interface for easy printing.
type Navigation struct { ClientRequest struct { Endpoint string `json:"endpoint,omitempty"` } `json:"client_request,omitempty"` ContentID string `json:"content_id,omitempty"` ContentType string `json:"contentType,omitempty"` MicroAppType string `json:"micro_app_type,omitempty"` Properties struct { Fullscreen bool `json:"fullscreen,omitempty"` IsLive bool `json:"isLive,omitempty"` VideoTitle string `json:"videoTitle,omitempty"` } `json:"properties,omitempty"` ScreenDesignType string `json:"screenDesignType,omitempty"` }
type Playback struct { BcovAuth string Sources []Source }
func GetPlayback(authToken string, videoId int) (*Playback, error)
func (*Playback) CachePath() string
func (p *Playback) GetDash() (*Source, error)
Properties holds all possible strongly-typed properties found in the UI nodes
type Properties struct { ID string `json:"id,omitempty"` PageType string `json:"pageType,omitempty"` ManifestType string `json:"manifestType,omitempty"` CountryCode string `json:"countryCode,omitempty"` Mode string `json:"mode,omitempty"` Orientation string `json:"orientation,omitempty"` Layout string `json:"layout,omitempty"` Scrollable bool `json:"scrollable,omitempty"` ContentType string `json:"contentType,omitempty"` Nid int `json:"nid,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` }
type Source struct { Codecs string KeySystems KeySystems `json:"key_systems"` Src *Url // MPD Type string }
func (*Source) CachePath() string
type Url struct { Url url.URL }
func (u *Url) MarshalText() ([]byte, error)
func (u *Url) UnmarshalText(text []byte) error