Documentation ¶
Overview ¶
Package radiko manages the radiko.jp APIs.
Index ¶
- func AreaID() (string, error)
- func DownloadPlayer(path string) error
- func GetChunklistFromM3U8(uri string) ([]string, error)
- func SetHTTPClient(client *http.Client)
- type Client
- func (c *Client) AreaID() string
- func (c *Client) Auth1Fms(ctx context.Context) (string, int64, int64, error)
- func (c *Client) Auth2Fms(ctx context.Context, authToken, partialKey string) ([]string, error)
- func (c *Client) AuthToken() string
- func (c *Client) AuthorizeToken(ctx context.Context, pngFilePath string) (string, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) GetNowPrograms(ctx context.Context) (Stations, error)
- func (c *Client) GetProgramByStartTime(ctx context.Context, stationID string, start time.Time) (*Prog, error)
- func (c *Client) GetStations(ctx context.Context, date time.Time) (Stations, error)
- func (c *Client) GetWeeklyPrograms(ctx context.Context, stationID string) (Stations, error)
- func (c *Client) Jar() http.CookieJar
- func (c *Client) Login(ctx context.Context, mail, password string) (Statuser, error)
- func (c *Client) SetAreaID(areaID string)
- func (c *Client) SetJar(jar *cookiejar.Jar)
- func (c *Client) TimeshiftPlaylistM3U8(ctx context.Context, stationID string, start time.Time) (string, error)
- type LoginNG
- type LoginOK
- type LoginStatus
- type Params
- type Prog
- type Progs
- type Scd
- type Station
- type Stations
- type Statuser
- type URLItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadPlayer ¶
DownloadPlayer downloads a swf player file.
func GetChunklistFromM3U8 ¶ added in v0.1.3
GetChunklistFromM3U8 returns a slice of url.
func SetHTTPClient ¶
SetHTTPClient overrides the default HTTP client.
Types ¶
type Client ¶
Client represents a single connection to radiko API endpoint.
func (*Client) AuthorizeToken ¶
AuthorizeToken returns an enables auth_token and error, and sets auth_token in Client. Is is a alias function that wraps Auth1Fms and Auth2Fms.
func (*Client) GetNowPrograms ¶
GetNowPrograms returns the program's meta-info which are currently on the air.
func (*Client) GetProgramByStartTime ¶
func (c *Client) GetProgramByStartTime(ctx context.Context, stationID string, start time.Time) (*Prog, error)
GetProgramByStartTime returns a specified program. This API wraps GetStations.
func (*Client) GetStations ¶
GetStations returns the program's meta-info.
func (*Client) GetWeeklyPrograms ¶ added in v0.2.0
GetWeeklyPrograms returns the weekly programs.
type LoginNG ¶ added in v0.2.0
type LoginNG struct { *LoginStatus Message string `json:"message"` Cause string `json:"cause"` }
LoginNG represents login failed.
type LoginOK ¶ added in v0.2.0
type LoginOK struct { *LoginStatus UserKey string `json:"user_key"` PaidMember string `json:"paid_member"` Areafree string `json:"areafree"` }
LoginOK represents login is successful.
type LoginStatus ¶ added in v0.2.0
type LoginStatus struct {
Status string `json:"status"`
}
LoginStatus is a base struct that has a Status field.
func (*LoginStatus) StatusCode ¶ added in v0.2.0
func (l *LoginStatus) StatusCode() int
StatusCode returns StatusCode that is type int.
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
Params is the list of options to pass to the request.
type Prog ¶
type Prog struct { Ft string `xml:"ft,attr"` To string `xml:"to,attr"` Ftl string `xml:"ftl,attr"` Tol string `xml:"tol,attr"` Dur string `xml:"dur,attr"` Title string `xml:"title"` SubTitle string `xml:"sub_title"` Desc string `xml:"desc"` Pfm string `xml:"pfm"` Info string `xml:"info"` URL string `xml:"url"` }
Prog is a struct.
type Station ¶
type Station struct { ID string `xml:"id,attr"` Name string `xml:"name"` Scd Scd `xml:"scd,omitempty"` Progs Progs `xml:"progs,omitempty"` }
Station is a struct.
type Statuser ¶ added in v0.2.0
type Statuser interface {
StatusCode() int
}
Statuser is the interface that wraps StatusCode method.
type URLItem ¶ added in v0.2.1
URLItem represents a stream url.
func GetStreamMultiURL ¶ added in v0.2.1
GetStreamMultiURL returns a slice of the stream url.