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

Index

Functions

func AcquireLicense(challenge []byte, token *ProfileToken, activePlayback *Playback) ([]byte, error)

SL2000 max 2160p

func GetStream(token *ProfileToken, activePlayback *Playback) (*url.URL, error)

Types

type AccountToken

type AccountToken struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	AccountId    string `json:"account_id"`
	Jti          string `json:"jti"`
}

Functions

func PerformLogin(username string, password string) (*AccountToken, error)

Methods

func (*AccountToken) CachePath() string

type ContentPackage

type ContentPackage struct {
	DurationInSeconds int    `json:"durationInSeconds"`
	Id                int    `json:"id"`
	IsDescribedVideo  bool   `json:"isDescribedVideo"`
	Language          string `json:"language"`
}

type Experience

type Experience struct {
	Id          string `json:"id"`
	Sku         string `json:"sku"`
	BrandId     string `json:"brandId"`
	DisplayName string `json:"displayName"`
}

type FirstContent

type FirstContent struct {
	Id int `json:"id,string"`
}

type Media

type Media struct {
	FirstContent FirstContent `json:"firstContent"`
	Id           int          `json:"id,string"`
}

Functions

func GetMedia(showId int) (*Media, error)
func ParseMedia(rawUrl string) (*Media, error)

https://crave.ca/en/movie/anaconda-2025-59881 https://crave.ca/en/play/anaconda-2025-3300246 https://crave.ca/movie/anaconda-2025-59881 https://crave.ca/play/anaconda-2025-3300246 https://crave.ca/play/heated-rivalry/ill-believe-in-anything-s1e5-3233873

Methods

func (*Media) CachePath() string

type Playback

type Playback struct {
	ContentId      int            `json:"contentId,string"`
	ContentPackage ContentPackage `json:"contentPackage"`
	DestinationId  int            `json:"destinationId"`
	Error          string         // 2026-05-03
}

Functions

func GetPlayback(token *ProfileToken, activeMedia *Media) (*Playback, error)

Methods

func (*Playback) CachePath() string

type Profile

type Profile struct {
	Id                string   `json:"id"`
	AccountId         string   `json:"accountId"`
	Nickname          string   `json:"nickname"`
	HasPin            bool     `json:"hasPin"`
	Master            bool     `json:"master"`
	Maturity          string   `json:"maturity"`
	Onboarded         bool     `json:"onboarded"`
	UiLanguage        string   `json:"uiLanguage"`
	PlaybackLanguages []string `json:"playbackLanguages"`
	LastModifiedDate  string   `json:"lastModifiedDate"`
	AvatarUrl         string   `json:"avatarUrl"`
}

Functions

func GetProfiles(account *AccountToken) ([]Profile, error)

Methods

func (p *Profile) String() string

type ProfileToken

type ProfileToken struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
}

Functions

func SwitchProfile(account *AccountToken, profileId string) (*ProfileToken, error)

Methods

func (*ProfileToken) CachePath() string

type Subscription

type Subscription struct {
	Type              string     `json:"type"`
	Experience        Experience `json:"experience"`
	SubscriptionState string     `json:"subscriptionState"`
	StoreName         string     `json:"storeName"`
	ExpirationDate    string     `json:"expirationDate"`
	AutoRenewStatus   bool       `json:"autoRenewStatus"`
}

Functions

func GetSubscriptions(token *ProfileToken) ([]Subscription, error)

Methods

func (s *Subscription) String() string