Documentation ¶
Index ¶
- Constants
- type API
- func (a *API) GetAlbum(ctx context.Context, albumId string) (*api.Collection, error)
- func (a *API) GetAlbumRaw(ctx context.Context, albumId string) (*AlbumResponse, error)
- func (a *API) GetArtist(ctx context.Context, tingUid string) (*api.Collection, error)
- func (a *API) GetArtistRaw(ctx context.Context, tingUid string, offset int, limits int) (*ArtistResponse, error)
- func (a *API) GetPlaylist(ctx context.Context, playlistId string) (*api.Collection, error)
- func (a *API) GetPlaylistRaw(ctx context.Context, playlistId string) (*PlaylistResponse, error)
- func (a *API) GetSong(ctx context.Context, songId string) (*api.Song, error)
- func (a *API) GetSongLyric(ctx context.Context, songId string) (string, error)
- func (a *API) GetSongLyricRaw(ctx context.Context, songId string) (*SongLyricResponse, error)
- func (a *API) GetSongRaw(ctx context.Context, songId string) (*SongResponse, error)
- func (a *API) GetSongsRaw(ctx context.Context, songIds ...string) (*SongsResponse, error)
- func (a *API) SearchSongs(ctx context.Context, keyword string) ([]*api.Song, error)
- func (a *API) SearchSongsRaw(ctx context.Context, keyword string, page int, pageSize int) (*SearchSongsResponse, error)
- func (a *API) SendRequest(req *ghttp.Request) (*ghttp.Response, error)
- type AlbumResponse
- type ArtistResponse
- type CommonResponse
- type PlaylistResponse
- type SearchSongsResponse
- type Song
- type SongLyricResponse
- type SongResponse
- type SongsResponse
- type URL
Constants ¶
View Source
const ( Input = "2012171402992850" IV = "2012061402992850" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
func (*API) GetAlbumRaw ¶
获取专辑
func (*API) GetArtistRaw ¶
func (a *API) GetArtistRaw(ctx context.Context, tingUid string, offset int, limits int) (*ArtistResponse, error)
获取歌手
func (*API) GetPlaylist ¶
func (*API) GetPlaylistRaw ¶
获取歌单
func (*API) GetSongLyric ¶
func (*API) GetSongLyricRaw ¶
获取歌词
func (*API) GetSongRaw ¶
获取歌曲
func (*API) GetSongsRaw ¶
批量获取歌曲,遗留接口,不推荐使用
func (*API) SearchSongs ¶
func (*API) SearchSongsRaw ¶
func (a *API) SearchSongsRaw(ctx context.Context, keyword string, page int, pageSize int) (*SearchSongsResponse, error)
搜索歌曲
type AlbumResponse ¶
type AlbumResponse struct { CommonResponse AlbumInfo struct { AlbumId string `json:"album_id"` Title string `json:"title"` PicBig string `json:"pic_big"` } `json:"albumInfo"` SongList []*Song `json:"songlist"` }
百度的这个接口设计比较坑爹,无数据时albumInfo字段为数组类型,导致json反序列化失败
func (*AlbumResponse) String ¶
func (a *AlbumResponse) String() string
type ArtistResponse ¶
type ArtistResponse struct { CommonResponse ArtistInfo struct { TingUid string `json:"ting_uid"` Name string `json:"name"` AvatarBig string `json:"avatar_big"` } `json:"artistinfo"` SongList []*Song `json:"songlist"` }
func (*ArtistResponse) String ¶
func (a *ArtistResponse) String() string
type CommonResponse ¶
type PlaylistResponse ¶
type PlaylistResponse struct { CommonResponse Result struct { Info struct { ListId string `json:"list_id"` ListTitle string `json:"list_title"` ListPic string `json:"list_pic"` } `json:"info"` SongList []*Song `json:"songlist"` } `json:"result"` }
func (*PlaylistResponse) String ¶
func (p *PlaylistResponse) String() string
type SearchSongsResponse ¶
type SearchSongsResponse struct { CommonResponse Result struct { SongInfo struct { SongList []*Song `json:"song_list"` } `json:"song_info"` } `json:"result"` }
func (*SearchSongsResponse) String ¶
func (s *SearchSongsResponse) String() string
type Song ¶
type Song struct { SongId string `json:"song_id"` Title string `json:"title"` TingUid string `json:"ting_uid"` Author string `json:"author"` AlbumId string `json:"album_id"` AlbumTitle string `json:"album_title"` PicBig string `json:"pic_big"` LrcLink string `json:"lrclink"` CopyType string `json:"copy_type"` URL string `json:"-"` Lyric string `json:"-"` }
type SongLyricResponse ¶
type SongLyricResponse struct { CommonResponse Title string `json:"title"` LrcContent string `json:"lrcContent"` }
func (*SongLyricResponse) String ¶
func (s *SongLyricResponse) String() string
type SongResponse ¶
type SongResponse struct { CommonResponse SongInfo Song `json:"songinfo"` SongURL struct { URL []URL `json:"url"` } `json:"songurl"` }
func (*SongResponse) String ¶
func (s *SongResponse) String() string
type SongsResponse ¶
type SongsResponse struct { ErrorCode int `json:"errorCode"` Data struct { SongList []*struct { SongId int `json:"songId"` SongName string `json:"songName"` ArtistId string `json:"artistId"` ArtistName string `json:"artistName"` AlbumId int `json:"albumId"` AlbumName string `json:"albumName"` SongPicBig string `json:"songPicBig"` LrcLink string `json:"lrcLink"` CopyType int `json:"copyType"` SongLink string `json:"songLink"` ShowLink string `json:"showLink"` Format string `json:"format"` Rate int `json:"rate"` } `json:"songList"` } `json:"data"` }
func (*SongsResponse) String ¶
func (s *SongsResponse) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.