kuwo

package
v0.0.0-...-69f4c14 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Client *ghttp.Client
}

func Client

func Client() *API

func New

func New(client *ghttp.Client) *API

func (*API) GetAlbum

func (a *API) GetAlbum(ctx context.Context, albumId string) (*api.Collection, error)

func (*API) GetAlbumRaw

func (a *API) GetAlbumRaw(ctx context.Context, albumId string, page int, pageSize int) (*AlbumResponse, error)

获取专辑,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值

func (*API) GetArtist

func (a *API) GetArtist(ctx context.Context, artistId string) (*api.Collection, error)

func (*API) GetArtistInfoRaw

func (a *API) GetArtistInfoRaw(ctx context.Context, artistId string) (*ArtistInfoResponse, error)

获取歌手信息

func (*API) GetArtistSongsRaw

func (a *API) GetArtistSongsRaw(ctx context.Context, artistId string, page int, pageSize int) (*ArtistSongsResponse, error)

获取歌手歌曲,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值

func (*API) GetPlaylist

func (a *API) GetPlaylist(ctx context.Context, playlistId string) (*api.Collection, error)

func (*API) GetPlaylistRaw

func (a *API) GetPlaylistRaw(ctx context.Context, playlistId string, page int, pageSize int) (*PlaylistResponse, error)

获取歌单,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值

func (*API) GetSong

func (a *API) GetSong(ctx context.Context, mid string) (*api.Song, error)

func (*API) GetSongLyric

func (a *API) GetSongLyric(ctx context.Context, mid int) (string, error)

func (*API) GetSongLyricRaw

func (a *API) GetSongLyricRaw(ctx context.Context, mid int) (*SongLyricResponse, error)

获取歌词

func (*API) GetSongRaw

func (a *API) GetSongRaw(ctx context.Context, mid string) (*SongResponse, error)

获取歌曲详情

func (*API) GetSongURL

func (a *API) GetSongURL(ctx context.Context, mid int, br int) (string, error)

func (*API) GetSongURLRaw

func (a *API) GetSongURLRaw(ctx context.Context, mid int, br int) (*SongURLResponse, error)

获取歌曲播放地址,br: 比特率,128/192/320 可选

func (*API) SearchSongs

func (a *API) SearchSongs(ctx context.Context, keyword string) ([]*api.Song, error)

func (*API) SearchSongsRaw

func (a *API) SearchSongsRaw(ctx context.Context, keyword string, page int, pageSize int) (*SearchSongsResponse, error)

搜索歌曲

func (*API) SendRequest

func (a *API) SendRequest(req *ghttp.Request) (*ghttp.Response, error)

type AlbumResponse

type AlbumResponse struct {
	CommonResponse
	Data struct {
		AlbumId   int     `json:"albumId"`
		Album     string  `json:"album"`
		Pic       string  `json:"pic"`
		MusicList []*Song `json:"musicList"`
	} `json:"data"`
}

func (*AlbumResponse) String

func (a *AlbumResponse) String() string

type ArtistInfo

type ArtistInfo struct {
	Id     int    `json:"id"`
	Name   string `json:"name"`
	Pic300 string `json:"pic300"`
}

type ArtistInfoResponse

type ArtistInfoResponse struct {
	CommonResponse
	Data ArtistInfo `json:"data"`
}

func (*ArtistInfoResponse) String

func (a *ArtistInfoResponse) String() string

type ArtistSongsResponse

type ArtistSongsResponse struct {
	CommonResponse
	Data struct {
		List []*Song `json:"list"`
	} `json:"data"`
}

func (*ArtistSongsResponse) String

func (a *ArtistSongsResponse) String() string

type CommonResponse

type CommonResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg,omitempty"`
}

type PlaylistResponse

type PlaylistResponse struct {
	CommonResponse
	Data struct {
		Id        int     `json:"id"`
		Name      string  `json:"name"`
		Img700    string  `json:"img700"`
		MusicList []*Song `json:"musicList"`
	} `json:"data"`
}

func (*PlaylistResponse) String

func (p *PlaylistResponse) String() string

type SearchSongsResponse

type SearchSongsResponse struct {
	CommonResponse
	Data struct {
		Total string  `json:"total"`
		List  []*Song `json:"list"`
	} `json:"data"`
}

func (*SearchSongsResponse) String

func (s *SearchSongsResponse) String() string

type Song

type Song struct {
	RId             int    `json:"rid"`
	Name            string `json:"name"`
	ArtistId        int    `json:"artistid"`
	Artist          string `json:"artist"`
	AlbumId         int    `json:"albumid"`
	Album           string `json:"album"`
	AlbumPic        string `json:"albumpic"`
	Track           int    `json:"track"`
	IsListenFee     bool   `json:"isListenFee"`
	SongTimeMinutes string `json:"songTimeMinutes"`
	Lyric           string `json:"-"`
	URL             string `json:"-"`
}

type SongLyricResponse

type SongLyricResponse struct {
	Status int    `json:"status"`
	Msg    string `json:"msg,omitempty"`
	Data   struct {
		LrcList []struct {
			Time      string `json:"time"`
			LineLyric string `json:"lineLyric"`
		} `json:"lrclist"`
	} `json:"data"`
}

func (*SongLyricResponse) String

func (s *SongLyricResponse) String() string

type SongResponse

type SongResponse struct {
	CommonResponse
	Data Song `json:"data"`
}

func (*SongResponse) String

func (s *SongResponse) String() string

type SongURLResponse

type SongURLResponse struct {
	CommonResponse
	URL string `json:"url"`
}

func (*SongURLResponse) String

func (s *SongURLResponse) String() string

Jump to

Keyboard shortcuts

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