Documentation ¶
Overview ¶
Package nicovideo is nicovideo.jp API wrapper.
Index ¶
- func IsPostedByUser(ID string) bool
- type Client
- func (c *Client) Download(ID string) (io.ReadCloser, error)
- func (c *Client) GetDailyAllRanking() (*Ranking, error)
- func (c *Client) GetRanking(typ RankingType, genre RankingGenre, span RankingSpan) (*Ranking, error)
- func (c *Client) GetVideoDetails(ID string) (*VideoDetails, error)
- func (c *Client) Login(email, password string) error
- type Ranking
- type RankingGenre
- type RankingSpan
- type RankingType
- type VideoDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPostedByUser ¶
IsPostedByUser returns true if video ID starts with "sm", namely posted by user.
Types ¶
type Client ¶
Client manages cookies.
func (*Client) Download ¶
func (c *Client) Download(ID string) (io.ReadCloser, error)
Download takes video ID and returns content as io.ReadCloser
func (*Client) GetDailyAllRanking ¶
GetDailyAllRanking returns array of video IDs.
func (*Client) GetRanking ¶
func (c *Client) GetRanking( typ RankingType, genre RankingGenre, span RankingSpan, ) (*Ranking, error)
GetRanking returns array of video IDs.
func (*Client) GetVideoDetails ¶
func (c *Client) GetVideoDetails(ID string) (*VideoDetails, error)
GetVideoDetails takes video ID and returns details.
type Ranking ¶
type Ranking struct { Status string `xml:"status,attr"` Count int `xml:"count"` VideoInfos []struct { Video struct { ID string `xml:"id"` IsDeleted bool `xml:"deleted"` } `xml:"video"` } `xml:"video_info"` }
Ranking represents ranking.
type RankingGenre ¶
type RankingGenre string
RankingGenre is type of genre.
const (
RankingGenreAll RankingGenre = "all"
)
Ranking genres.
type RankingSpan ¶
type RankingSpan string
RankingSpan is type of ranking span.
const (
RankingSpanDaily RankingSpan = "daily"
)
Ranking spans.
type RankingType ¶
type RankingType string
RankingType is type of ranking type.
const (
RankingTypeView RankingType = "view"
)
Ranking types.
Click to show internal directories.
Click to hide internal directories.