asset.go search.go signin.go
const DeviceID = "x-device-id"
DeviceID is the centralized value used for the x-device-id header across all requests.
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"` }
func GetAsset(assetID string, signinResp *SigninResponse) (*AssetResponse, error)
GetAsset retrieves the asset playback details using the auth and user contexts.
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 struct { Endpoint struct { Payload struct { Payload struct { UiElement string `json:"ui.element"` AssetId string `json:"asset.asset_id"` } `json:"payload"` } `json:"payload"` } `json:"endpoint"` }
func Search(query string, signinResp *SigninResponse) ([]SearchComponent, error)
Search searches for content (VODs or Live Streams) using a query string.
func (s *SearchComponent) String() string
type SigninRequest struct { Username string `json:"username"` Password string `json:"password"` }
type SigninResponse struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` }
func Signin(username, password string) (*SigninResponse, error)
too many calls gets 429
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.