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) }, }
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
type Error struct { Detail string // show was filtered by validator Message string // Token is missing or not valid }
func (e *Error) Error() string
type Initiate struct { LinkingCode string TargetUrl string }
func (i *Initiate) String() string
type Login struct { Data struct { Attributes struct { Token string } } }
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 []byte
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 } }
func (p *Playback) Mpd() string
func (p *Playback) PlayReady(data []byte) ([]byte, error)
func (p *Playback) Widevine(data []byte) ([]byte, error)
type Scheme struct { LicenseUrl string }
type St [1]*http.Cookie
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 struct { Attributes *struct { SeasonNumber int EpisodeNumber int Name string VideoType string } Relationships *struct { Edit *struct { Data struct { Id string } } } }
func (v *Video) String() string
type Videos struct { Errors []Error Included []*Video }
func (v *Videos) FilterAndSort()