Package stan (v1.11.6) [up] [repository]

Index

Constants

const (
	StanName    = "Stan-AndroidTV"
	StanVersion = "4.32.1"
)

Variables

var BaseUrl = []string{
	"aws.stan.video",
	"gec.stan.video",

	"023-stan.akamaized.net",
	"666-stan.akamaized.net",
}

Types

type APIError

type APIError struct {
	Code string
}

type APIErrors

type APIErrors []APIError

Methods

func (e APIErrors) Error() string

type ActivationCode

type ActivationCode struct {
	Code string
	Url  string
}

Functions

func FetchActivationCode() (*ActivationCode, error)

Methods

func (*ActivationCode) CachePath() string
func (a *ActivationCode) String() string
func (a *ActivationCode) Token() (*WebToken, error)

type AppSession

AppSession is the full session response from /login/v1/sessions/app. FIX: expanded to match Python _oauth() response fields.

type AppSession struct {
	JwToken string
	Renew   int64
	Now     int64
	UserId  string
	Profile Profile
	Errors  APIErrors
}

Methods

func (*AppSession) CachePath() string
func (a *AppSession) FetchMedia(id int, quality, drm string) (*Media, error)

DRM options: "widevine" or "playready". Quality options: "sd" (540p), "high" (1080p), "ultra" (2160p), "auto".

type DTError

DTError is an error returned by the DRM Today license server.

type DTError struct {
	RespCode string // x-dt-resp-code header, e.g. "20101"
	Message  string // x-dt-error-message header, e.g. "not_granted"
}

Methods

func (e *DTError) Error() string

type Media

type Media struct {
	Drm *struct {
		CustomData       string
		KeyId            string
		LicenseServerUrl string
	}
	VideoUrl string
}

Methods

func (m *Media) BaseUrl(host string) (*url.URL, error)
func (*Media) CachePath() string
func (m *Media) LicensePlayReady(data []byte) ([]byte, error)

LicensePlayReady requests a PlayReady license. The response is raw XML.

func (m *Media) LicenseWidevine(data []byte) ([]byte, error)

LicenseWidevine requests a Widevine license. The response is JSON-wrapped.

type Profile

Profile represents a Stan user profile.

type Profile struct {
	Id            string
	Name          string
	IsKidsProfile bool
}

type WebToken

WebToken is the intermediate token returned from the activation URL. It is used as the payload for the session request.

type WebToken struct {
	JwToken string
}

Methods

func (*WebToken) CachePath() string
func (w *WebToken) FetchSession() (*AppSession, error)

FetchSession exchanges the WebToken for a full AppSession. FIX: uses /login/v1/sessions/app (not /sessions/mobile/app), includes device data in the payload, and handles error responses.