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

Index

Types

type Dash

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

type File

type File struct {
	DrmAuthorizationToken string `json:"drm_authorization_token"`
	Links                 struct {
		Source struct {
			Href string // MPD
		}
	} `json:"_links"`
	Method string
}

Methods

func (f *File) FetchDash() (*Dash, error)
func (f *File) FetchWidevine(data []byte) ([]byte, error)

type Files

type Files []File

Methods

func (f Files) GetDash() (*File, error)

type Item

type Item struct {
	Links struct {
		Files struct {
			Href string // https://api.vhx.tv/videos/3460957/files
		}
	} `json:"_links"`
}

type Token

type Token struct {
	AccessToken      string `json:"access_token"`
	Error            string
	ErrorDescription string `json:"error_description"`
	RefreshToken     string `json:"refresh_token"`
}

Functions

func FetchToken(username, password string) (*Token, error)

Methods

func (t *Token) AsError() error

AsError returns a standard Go error if the token response was an error, otherwise it returns nil.

func (t *Token) FetchFiles(filesHref string) (Files, error)
func (t *Token) FetchItem(slug string) (*Item, error)
func (t *Token) Refresh() error