Documentation
¶
Index ¶
- Constants
- func Client() provider.API
- func GetAlbum(albumId string) (*provider.Album, error)
- func GetArtist(artistId string) (*provider.Artist, error)
- func GetPlaylist(playlistId string) (*provider.Playlist, error)
- func GetSong(mid string) (*provider.Song, error)
- func GetSongLyric(mid int) (string, error)
- func GetSongURL(mid int, br int) (string, error)
- func Request(method string, url string, opts ...sreq.RequestOption) *sreq.Response
- func SearchSong(keyword string) (*provider.SearchResult, error)
- type API
- func (a *API) GetAlbum(albumId string) (*provider.Album, error)
- func (a *API) GetAlbumRaw(albumId string, page int, pageSize int) (*AlbumResponse, error)
- func (a *API) GetArtist(artistId string) (*provider.Artist, error)
- func (a *API) GetArtistInfoRaw(artistId string) (*ArtistInfoResponse, error)
- func (a *API) GetArtistSongRaw(artistId string, page int, pageSize int) (*ArtistSongResponse, error)
- func (a *API) GetPlaylist(playlistId string) (*provider.Playlist, error)
- func (a *API) GetPlaylistRaw(playlistId string, page int, pageSize int) (*PlaylistResponse, error)
- func (a *API) GetSong(mid string) (*provider.Song, error)
- func (a *API) GetSongLyric(mid int) (string, error)
- func (a *API) GetSongLyricRaw(mid int) (*SongLyricResponse, error)
- func (a *API) GetSongRaw(mid string) (*SongResponse, error)
- func (a *API) GetSongURL(mid int, br int) (string, error)
- func (a *API) GetSongURLRaw(mid int, br int) (*SongURLResponse, error)
- func (a *API) Platform() int
- func (a *API) Request(method string, url string, opts ...sreq.RequestOption) *sreq.Response
- func (a *API) SearchSong(keyword string) (*provider.SearchResult, error)
- func (a *API) SearchSongRaw(keyword string, page int, pageSize int) (*SongSearchResponse, error)
- type AlbumResponse
- type ArtistInfo
- type ArtistInfoResponse
- type ArtistSongResponse
- type CommonResponse
- type PlaylistResponse
- type Song
- type SongLyricResponse
- type SongResponse
- type SongSearchResponse
- type SongURLResponse
Constants ¶
View Source
const ( SearchAPI = "http://www.kuwo.cn/api/www/search/searchMusicBykeyWord" GetSongAPI = "http://www.kuwo.cn/api/www/music/musicInfo" GetSongPlayAPI = "http://www.kuwo.cn/url?format=mp3&response=url&type=convert_url3" GetSongLyricAPI = "http://www.kuwo.cn/newh5/singles/songinfoandlrc" GetArtistInfoAPI = "http://www.kuwo.cn/api/www/artist/artist" GetArtistSongAPI = "http://www.kuwo.cn/api/www/artist/artistMusic" GetAlbumAPI = "http://www.kuwo.cn/api/www/album/albumInfo" GetPlaylistAPI = "http://www.kuwo.cn/api/www/playlist/playListInfo" SongDefaultBR = 128 )
Variables ¶
This section is empty.
Functions ¶
func GetSongLyric ¶
func SearchSong ¶
func SearchSong(keyword string) (*provider.SearchResult, error)
Types ¶
type API ¶
func (*API) GetAlbumRaw ¶
获取专辑,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值
func (*API) GetArtistInfoRaw ¶
func (a *API) GetArtistInfoRaw(artistId string) (*ArtistInfoResponse, error)
获取歌手信息
func (*API) GetArtistSongRaw ¶
func (a *API) GetArtistSongRaw(artistId string, page int, pageSize int) (*ArtistSongResponse, error)
获取歌手歌曲,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值
func (*API) GetPlaylistRaw ¶
获取歌单,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值
func (*API) GetSongLyricRaw ¶
func (a *API) GetSongLyricRaw(mid int) (*SongLyricResponse, error)
获取歌词
func (*API) GetSongURLRaw ¶
func (a *API) GetSongURLRaw(mid int, br int) (*SongURLResponse, error)
获取歌曲播放地址,br: 比特率,128/192/320 可选
func (*API) SearchSong ¶
func (a *API) SearchSong(keyword string) (*provider.SearchResult, error)
func (*API) SearchSongRaw ¶
搜索歌曲
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 GetAlbumRaw ¶
func GetAlbumRaw(albumId string, page int, pageSize int) (*AlbumResponse, error)
func (*AlbumResponse) String ¶
func (a *AlbumResponse) String() string
type ArtistInfo ¶
type ArtistInfoResponse ¶
type ArtistInfoResponse struct {
CommonResponse
Data ArtistInfo `json:"data"`
}
func GetArtistInfoRaw ¶
func GetArtistInfoRaw(artistId string) (*ArtistInfoResponse, error)
func (*ArtistInfoResponse) String ¶
func (a *ArtistInfoResponse) String() string
type ArtistSongResponse ¶
type ArtistSongResponse struct {
CommonResponse
Data struct {
List []*Song `json:"list"`
} `json:"data"`
}
func GetArtistSongRaw ¶
func GetArtistSongRaw(artistId string, page int, pageSize int) (*ArtistSongResponse, error)
func (*ArtistSongResponse) String ¶
func (a *ArtistSongResponse) String() string
type CommonResponse ¶
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 GetPlaylistRaw ¶
func GetPlaylistRaw(playlistId string, page int, pageSize int) (*PlaylistResponse, error)
func (*PlaylistResponse) String ¶
func (p *PlaylistResponse) 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 GetSongLyricRaw ¶
func GetSongLyricRaw(mid int) (*SongLyricResponse, error)
func (*SongLyricResponse) String ¶
func (s *SongLyricResponse) String() string
type SongResponse ¶
type SongResponse struct {
CommonResponse
Data Song `json:"data"`
}
func GetSongRaw ¶
func GetSongRaw(mid string) (*SongResponse, error)
func (*SongResponse) String ¶
func (s *SongResponse) String() string
type SongSearchResponse ¶
type SongSearchResponse struct {
CommonResponse
Data struct {
Total string `json:"total"`
List []*Song `json:"list"`
} `json:"data"`
}
func SearchSongRaw ¶
func SearchSongRaw(keyword string, page int, pageSize int) (*SongSearchResponse, error)
func (*SongSearchResponse) String ¶
func (s *SongSearchResponse) String() string
type SongURLResponse ¶
type SongURLResponse struct {
CommonResponse
URL string `json:"url"`
}
func GetSongURLRaw ¶
func GetSongURLRaw(mid int, br int) (*SongURLResponse, error)
func (*SongURLResponse) String ¶
func (s *SongURLResponse) String() string
Click to show internal directories.
Click to hide internal directories.