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

Index

Constants

const Markets = "amer apac emea latam"

Types

type APIError

APIError represents a single error object from the Max API

type APIError struct {
	Code   string `json:"code"`
	Detail string `json:"detail"`
}

type APIErrors

APIErrors represents a collection of API errors and implements the error interface

type APIErrors []APIError

Methods

func (e APIErrors) Error() string
type Cookie struct {
	Name  string
	Value string
}

Functions

func StRequest() (*Cookie, error)

Methods

func (*Cookie) CachePath() string
func (c *Cookie) String() string

type Entity

Entity represents a single unified node in the Max API response

type Entity struct {
	Attributes struct {
		Name          string
		Alias         string
		ShowType      string
		VideoType     string
		MaterialType  string
		Description   string
		SeasonNumber  int
		EpisodeNumber int
		AirDate       string
	}
	Id            string
	Relationships struct {
		Edit struct {
			Data Resource
		}
		Items struct {
			Data []Resource
		}
		Show struct {
			Data Resource
		}
		Video struct {
			Data Resource
		}
	}
	Type string
}

Functions

func MovieRequest(token, movieId string) ([]*Entity, error)
func MovieResults(entities []*Entity) []*Entity
func SearchRequest(token, query string) ([]*Entity, error)
func SearchResults(entities []*Entity) ([]*Entity, error)
func SeasonRequest(token, showId string, seasonNumber int) ([]*Entity, error)
func SeasonResults(entities []*Entity) []*Entity

Methods

func (e *Entity) String() string

String implements the fmt.Stringer interface to provide a clean visual output for the Entity

type Initiate

type Initiate struct {
	LinkingCode string
	TargetUrl   string
}

Functions

func InitiateRequest(st *Cookie, market string) (*Initiate, error)

Methods

func (i *Initiate) String() string

type Login

type Login struct {
	Token string
}

Functions

func LoginRequest(st *Cookie) (*Login, error)

you must /authentication/linkDevice/initiate first or this will always fail

Methods

func (*Login) CachePath() string

type Playback

type Playback struct {
	Drm struct {
		Schemes struct {
			PlayReady *Scheme
			Widevine  *Scheme
		}
	}
	Errors   APIErrors `json:"errors"`
	Fallback struct {
		Manifest struct {
			Url string // _fallback.mpd:1080p, .mpd:4K
		}
	}
	Manifest struct {
		Url string // 1080p
	}
}

Functions

func PlayReadyRequest(token, editId string) (*Playback, error)
func WidevineRequest(token, editId string) (*Playback, error)

Methods

func (*Playback) CachePath() string
func (p *Playback) GetManifest() (*url.URL, error)
func (p *Playback) PlayReadyRequest(body []byte) ([]byte, error)

SL2000 max 1080p SL3000 max 2160p

func (p *Playback) WidevineRequest(body []byte) ([]byte, error)

type Resource

Resource represents a relationship pointer in the JSON:API graph

type Resource struct {
	Id   string
	Type string
}

type Scheme

type Scheme struct {
	LicenseUrl string
}