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

asset.go

search.go

signin.go

Index

Constants

const DeviceID = "x-device-id"

DeviceID is the centralized value used for the x-device-id header across all requests.

Types

type AssetResponse

type AssetResponse struct {
	Stream struct {
		URL string `json:"url"` // The MPD URL
	} `json:"stream"`
	DRM struct {
		LicenseURL string `json:"licenseUrl"`
		Token      string `json:"token"`
	} `json:"drm"`
}

Functions

func GetAsset(assetID string, signinResp *SigninResponse) (*AssetResponse, error)

GetAsset retrieves the asset playback details using the auth and user contexts.

Methods

func (*AssetResponse) CachePath() string
func (a *AssetResponse) GetLicense(challenge []byte) ([]byte, error)

GetLicense requests the DRM license. As a method on *AssetResponse, it can be used directly as a closure: func([]byte) ([]byte, error).

type SearchComponent

type SearchComponent struct {
	Endpoint struct {
		Payload struct {
			Payload struct {
				UiElement string `json:"ui.element"`
				AssetId   string `json:"asset.asset_id"`
			} `json:"payload"`
		} `json:"payload"`
	} `json:"endpoint"`
}

Functions

Search searches for content (VODs or Live Streams) using a query string.

Methods

func (s *SearchComponent) String() string

type SigninRequest

type SigninRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type SigninResponse

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

Functions

func Signin(username, password string) (*SigninResponse, error)

too many calls gets 429

Methods

func (*SigninResponse) CachePath() string
func (s *SigninResponse) Refresh() error

Refresh uses the Fubo API endpoint to obtain a new access and refresh token, overwriting the tokens in the receiver.