Package rakuten (v1.11.1) [up] [repository]

Index

Constants

const DeviceId = "atvui40"

Constants for device and player configuration

Types

type Content

Content represents the parsed Rakuten URL data

type Content struct {
	Id               string
	MarketCode       string
	Type             string
	ClassificationId int
}

Functions

func ParseContent(urlData string) (*Content, error)

Parse extracts metadata from a Rakuten URL and returns a new Content struct

Methods

func (c *Content) IsMovie() bool
func (c *Content) IsTvShow() bool
func (c *Content) Movie() (*MovieOrEpisode, error)
func (c *Content) Season(seasonId string) (*Season, error)

Season fetches episodes for a specific season (GET).

func (c *Content) Stream(id, audioLanguage string, playerData Player, quality VideoQuality) (*Stream, error)

Stream requests a playback stream. For TV Shows, 'id' should be the Episode ID. For Movies, 'id' is ignored (uses c.Id).

func (c *Content) TvShow() (*TvShow, error)

type Dash

type Dash struct {
	Body []byte
	Url  *url.URL
}

type Error

type Error struct {
	Code    string
	Message string
}

Methods

func (e *Error) Error() string

type MovieOrEpisode

type MovieOrEpisode struct {
	Title       string `json:"title"`
	Id          string `json:"id"`
	ViewOptions struct {
		Private struct {
			Streams []struct {
				AudioLanguages []struct {
					Id string `json:"id"`
				} `json:"audio_languages"`
			} `json:"streams"`
		} `json:"private"`
	} `json:"view_options"`
}

Methods

func (m *MovieOrEpisode) String() string

String implementation for MovieOrEpisode to pretty print details

type Player

type Player string

Constants

const (
	PlayReady Player = DeviceId + ":DASH-CENC:PR"
	Widevine  Player = DeviceId + ":DASH-CENC:WVM"
)

type Season

type Season struct {
	Episodes []MovieOrEpisode `json:"episodes"`
}

type Stream

type Stream struct {
	StreamInfos []struct {
		LicenseUrl string `json:"license_url"`
		Url        string `json:"url"`
	} `json:"stream_infos"`
}

Methods

func (s Stream) Dash() (*Dash, error)
func (s Stream) Widevine(data []byte) ([]byte, error)

type TvShow

type TvShow struct {
	Seasons []struct {
		Id string `json:"id"`
	} `json:"seasons"`
}

Methods

func (t TvShow) String() string

type VideoQuality

type VideoQuality string

Constants

const (
	Fhd VideoQuality = "FHD"
	Hd  VideoQuality = "HD"
)