radiko

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2016 License: MIT Imports: 18 Imported by: 0

README

Go Radiko

godoc build codecov go report

The unofficial radiko.jp APIs Client Library for Go

License


The MIT License

Author

Yoshiki Nakagawa

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreaID

func AreaID() (string, error)

AreaID returns areaID.

func DownloadPlayer

func DownloadPlayer(path string) error

DownloadPlayer downloads swf player file.

func SetHTTPClient

func SetHTTPClient(client *http.Client)

SetHTTPClient overrides the default HTTP client.

Types

type Client

type Client struct {
	URL *url.URL
	// contains filtered or unexported fields
}

Client represents a single connection to radiko API endpoint.

func New

func New(authToken string) (*Client, error)

New returns new Client struct.

func (*Client) Auth1Fms

func (c *Client) Auth1Fms(ctx context.Context) (string, int64, int64, error)

Auth1Fms returns authToken, keyLength, keyOffset and error.

func (*Client) Auth2Fms

func (c *Client) Auth2Fms(ctx context.Context, authToken, partialKey string) ([]string, error)

Auth2Fms enables the given authToken.

func (*Client) AuthorizeToken

func (c *Client) AuthorizeToken(ctx context.Context, pngFilePath string) (string, error)

AuthorizeToken returns an enables auth_token and error, and sets auth_token in Client. Is is a alias function which wrapes Auth1Fms and Auth2Fms.

func (*Client) Call

func (c *Client) Call(req *http.Request) (*http.Response, error)

Call executes an API request.

func (*Client) CallWithAuthTokenHeader

func (c *Client) CallWithAuthTokenHeader(req *http.Request) (*http.Response, error)

CallWithAuthTokenHeader executes an API request with auth_token in HTTP Header.

func (*Client) GetNowPrograms

func (c *Client) GetNowPrograms(ctx context.Context) (Stations, error)

GetNowPrograms returns program's meta-info in the current location. This API wrapes GetNowProgramsByAreaID.

func (*Client) GetNowProgramsByAreaID

func (c *Client) GetNowProgramsByAreaID(ctx context.Context, areaID string) (Stations, error)

GetNowProgramsByAreaID returns 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 wrapes GetStations.

func (*Client) GetStations

func (c *Client) GetStations(ctx context.Context, date time.Time) (Stations, error)

GetStations returns program's meta-info in the current location. This API wrapes GetStationsByAreaID.

func (*Client) GetStationsByAreaID

func (c *Client) GetStationsByAreaID(ctx context.Context, areaID string, date time.Time) (Stations, error)

GetStationsByAreaID returns program's meta-info.

func (*Client) TimeshiftPlaylistM3U8

func (c *Client) TimeshiftPlaylistM3U8(ctx context.Context, stationID string, start time.Time) (string, error)

TimeshiftPlaylistM3U8 returns uri.

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 Progs

type Progs struct {
	Date  string `xml:"date"`
	Progs []Prog `xml:"prog"`
}

Progs is a slice of Prog.

type Scd

type Scd struct {
	Progs Progs `xml:"progs"`
}

Scd 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 Stations

type Stations []Station

Stations is a slice of Station.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL