Package hboMax (v1.10.6) [repository]

Index

Variables

var Transport = http.Transport{
	Protocols: &http.Protocols{},
	Proxy: func(req *http.Request) (*url.URL, error) {
		if path.Ext(req.URL.Path) == ".mp4" {
			return nil, nil
		}
		log.Println(req.Method, req.URL)
		return http.ProxyFromEnvironment(req)
	},
}

Functions

func ExtractId(rawUrl string) (string, error)

https://hbomax.com/movies/weapons/bcbb6e0d-ca89-43e4-a9b1-2fc728145beb https://play.hbomax.com/show/bcbb6e0d-ca89-43e4-a9b1-2fc728145beb

Types

type Error

type Error struct {
	Detail  string // show was filtered by validator
	Message string // Token is missing or not valid
}

Methods

func (e *Error) Error() string

type Initiate

type Initiate struct {
	LinkingCode string
	TargetUrl   string
}

Methods

func (i *Initiate) String() string

type Login

type Login struct {
	Data struct {
		Attributes struct {
			Token string
		}
	}
}

Methods

func (l Login) Movie(show_id string) (*Videos, error)
func (l *Login) PlayReady(edit_id string) (*Playback, error)
func (l Login) Season(show_id string, number int) (*Videos, error)
func (l *Login) Unmarshal(data LoginData) error
func (l *Login) Widevine(edit_id string) (*Playback, error)

type LoginData

type LoginData []byte

type Playback

type Playback struct {
	Drm struct {
		Schemes struct {
			PlayReady *Scheme
			Widevine  *Scheme
		}
	}
	Errors   []Error
	Fallback struct {
		Manifest struct {
			Url string // _fallback.mpd:1080p, .mpd:4K
		}
	}
	Manifest struct {
		Url string // 1080p
	}
}

Methods

func (p *Playback) Mpd() string
func (p *Playback) PlayReady(data []byte) ([]byte, error)
func (p *Playback) Widevine(data []byte) ([]byte, error)

type Scheme

type Scheme struct {
	LicenseUrl string
}

type St

type St [1]*http.Cookie

Methods

func (s St) Initiate() (*Initiate, error)
func (s St) Login() (LoginData, error)

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

func (s *St) Set(data string) error
func (s St) String() string
func (s *St) Token() error

type Video

type Video struct {
	Attributes *struct {
		SeasonNumber  int
		EpisodeNumber int
		Name          string
		VideoType     string
	}
	Relationships *struct {
		Edit *struct {
			Data struct {
				Id string
			}
		}
	}
}

Methods

func (v *Video) String() string

type Videos

type Videos struct {
	Errors   []Error
	Included []*Video
}

Methods

func (v *Videos) FilterAndSort()