Package amc (v1.11.1) [up] [repository]

Index

Functions

func BcJwt(header http.Header) string

Types

type Client

type Client struct {
	Data struct {
		AccessToken  string `json:"access_token"`
		RefreshToken string `json:"refresh_token"`
	}
}

Functions

func Unauth() (*Client, error)

Methods

func (c *Client) Login(email, password string) error
func (c *Client) Playback(id int) ([]Source, http.Header, error)
func (c *Client) Refresh() error
func (c *Client) Season(id int) (*Season, error)
func (c *Client) Series(id int) (*Series, error)

type Dash

type Dash struct {
	Body []byte
	Url  *url.URL
}

type Metadata

type Metadata struct {
	EpisodeNumber int
	Nid           int
	Title         string
}

Methods

func (m *Metadata) String() string

type Season

Season replaces the generic Node for the SeasonEpisodes endpoint. It lacks the heavy 'Text' property wrapper to optimize JSON unmarshaling.

type Season struct {
	Children   []Season
	Properties struct {
		Metadata *Metadata
	}
	Type string
}

Methods

func (s *Season) Episodes() ([]*Metadata, error)

Episodes extracts metadata exclusively from a Season

type Series

type Series struct {
	Children   []Series
	Properties struct {
		Metadata *Metadata
		Text     *struct {
			Title struct {
				Title string
			}
		}
	}
	Type string
}

Methods

func (s *Series) Seasons() ([]*Metadata, error)

Seasons extracts metadata exclusively from a Series

type Source

type Source struct {
	KeySystems struct {
		ComWidevineAlpha *struct {
			LicenseUrl string `json:"license_url"`
		} `json:"com.widevine.alpha"`
	} `json:"key_systems"`
	Src  string // URL to the MPD manifest
	Type string // e.g., "application/dash+xml"
}

Functions

func GetDash(sources []Source) (*Source, error)

Methods

func (s *Source) Dash() (*Dash, error)
func (s *Source) Widevine(bcJwt string, data []byte) ([]byte, error)