Package molotov (v1.10.9) [up] [repository]

Index

Types

type Asset

type Asset struct {
	Drm struct {
		Token string
	}
	Error  *AssetError
	Stream struct {
		Url string // MPD
	}
}

Methods

func (a *Asset) Dash() (*Dash, error)
func (a *Asset) Widevine(data []byte) ([]byte, error)

type AssetError

type AssetError struct {
	DeveloperMessage string `json:"developer_message"`
	UserMessage      string `json:"user_message"`
}

Methods

func (a *AssetError) Error() string

type Dash

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

type Login

type Login struct {
	Auth struct {
		AccessToken  string `json:"access_token"`
		RefreshToken string `json:"refresh_token"`
	}
}

Methods

func (l *Login) Asset(view *ProgramView) (*Asset, error)
func (l *Login) Fetch(email, password string) error
func (l *Login) ProgramView(rosso *MediaId) (*ProgramView, error)
func (l *Login) Refresh() error

authorization server issues a new refresh token, in which case the client MUST discard the old refresh token and replace it with the new refresh token

type MediaId

type MediaId struct {
	Program int
	Channel int
}

Methods

func (m *MediaId) Parse(link string) error

Parse extracts the IDs from a Molotov URL and populates the MediaId struct. It maps the first number in the URL to Program and the second to Channel.

type ProgramView

type ProgramView struct {
	Program struct {
		Actions struct {
			Play *struct {
				Url string // fapi.molotov.tv/v2/me/assets
			}
		}
	}
}