const ( StanName = "Stan-AndroidTV" StanVersion = "4.32.1" )
var BaseUrl = []string{ "aws.stan.video", "gec.stan.video", "023-stan.akamaized.net", "666-stan.akamaized.net", }
type APIError struct { Code string }
type APIErrors []APIError
func (e APIErrors) Error() string
type ActivationCode struct { Code string Url string }
func FetchActivationCode() (*ActivationCode, error)
func (*ActivationCode) CachePath() string
func (a *ActivationCode) String() string
func (a *ActivationCode) Token() (*WebToken, error)
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 }
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".
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" }
func (e *DTError) Error() string
type Media struct { Drm *struct { CustomData string KeyId string LicenseServerUrl string } VideoUrl string }
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.
Profile represents a Stan user profile.
type Profile struct { Id string Name string IsKidsProfile bool }
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 }
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.