Documentation ¶
Index ¶
- type API
- func (a *API) GetAlbum(ctx context.Context, albumMid string) (*api.Collection, error)
- func (a *API) GetAlbumRaw(ctx context.Context, albumMid string) (*AlbumResponse, error)
- func (a *API) GetArtist(ctx context.Context, singerMid string) (*api.Collection, error)
- func (a *API) GetArtistRaw(ctx context.Context, singerMid string, page int, pageSize 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, songMid string) (*api.Song, error)
- func (a *API) GetSongLyric(ctx context.Context, songMid string) (string, error)
- func (a *API) GetSongLyricRaw(ctx context.Context, songMid string) (*SongLyricResponse, error)
- func (a *API) GetSongRaw(ctx context.Context, songMid string) (*SongResponse, error)
- func (a *API) GetSongURLV1(ctx context.Context, songMid string, mediaMid string) (string, error)
- func (a *API) GetSongURLV1Raw(ctx context.Context, songMid string, mediaMid string) (*SongURLResponseV1, error)
- func (a *API) GetSongURLV2(ctx context.Context, songMid string) (string, error)
- func (a *API) GetSongsURLV2Raw(ctx context.Context, songMids ...string) (*SongURLResponseV2, 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 Album
- type AlbumResponse
- type ArtistResponse
- type CommonResponse
- type PlaylistResponse
- type SearchSongsResponse
- type Singer
- type Song
- type SongLyricResponse
- type SongResponse
- type SongURLResponseV1
- type SongURLResponseV2
Constants ¶
This section is empty.
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, singerMid string, page int, pageSize int) (*ArtistResponse, error)
获取歌手
func (*API) GetPlaylist ¶
func (*API) GetPlaylistRaw ¶
获取歌单
func (*API) GetSongLyric ¶
func (*API) GetSongLyricRaw ¶
获取歌词
func (*API) GetSongRaw ¶
获取歌曲详情
func (*API) GetSongURLV1 ¶
func (*API) GetSongURLV1Raw ¶
func (a *API) GetSongURLV1Raw(ctx context.Context, songMid string, mediaMid string) (*SongURLResponseV1, error)
获取歌曲播放地址
func (*API) GetSongURLV2 ¶
func (*API) GetSongsURLV2Raw ¶
批量获取歌曲播放地址
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 Data struct { GetAlbumInfo struct { FAlbumMid string `json:"Falbum_mid"` FAlbumName string `json:"Falbum_name"` } `json:"getAlbumInfo"` GetSongInfo []*Song `json:"getSongInfo"` } `json:"data"` }
func (*AlbumResponse) String ¶
func (a *AlbumResponse) String() string
type ArtistResponse ¶
type ArtistResponse struct { CommonResponse Data struct { SingerMid string `json:"singer_mid"` SingerName string `json:"singer_name"` List []struct { MusicData *Song `json:"musicData"` } `json:"list"` } `json:"data"` }
func (*ArtistResponse) String ¶
func (a *ArtistResponse) String() string
type CommonResponse ¶
type CommonResponse struct {
Code int `json:"code"`
}
type PlaylistResponse ¶
type PlaylistResponse struct { CommonResponse Data struct { CDList []struct { DissTid string `json:"disstid"` DissName string `json:"dissname"` Logo string `json:"logo"` PicURL string `json:"dir_pic_url2"` SongList []*Song `json:"songlist"` } `json:"cdlist"` } `json:"data"` }
func (*PlaylistResponse) String ¶
func (p *PlaylistResponse) String() string
type SearchSongsResponse ¶
type SearchSongsResponse struct { CommonResponse Data struct { Song struct { TotalNum int `json:"totalnum"` List []*Song `json:"list"` } `json:"song"` } `json:"data"` }
func (*SearchSongsResponse) String ¶
func (s *SearchSongsResponse) String() string
type Song ¶
type Song struct { Mid string `json:"mid"` Title string `json:"title"` Singer []Singer `json:"singer"` Album Album `json:"album"` Track int `json:"index_album"` Action struct { Switch int `json:"switch"` } `json:"action"` File struct { MediaMid string `json:"media_mid"` } `json:"file"` Lyric string `json:"-"` URL string `json:"-"` }
type SongLyricResponse ¶
type SongLyricResponse struct { CommonResponse Lyric string `json:"lyric"` Trans string `json:"trans"` }
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 SongURLResponseV1 ¶
type SongURLResponseV1 struct { Code int `json:"code"` Cid int `json:"cid"` ErrInfo string `json:"errinfo,omitempty"` Data struct { Expiration int `json:"expiration"` Items []struct { SubCode int `json:"subcode"` SongMid string `json:"songmid"` FileName string `json:"filename"` Vkey string `json:"vkey"` } `json:"items"` } `json:"data"` }
type SongURLResponseV2 ¶
type SongURLResponseV2 struct { CommonResponse Req0 struct { Code int `json:"code"` Data struct { MidURLInfo []struct { FileName string `json:"filename"` PURL string `json:"purl"` SongMid string `json:"songmid"` Vkey string `json:"vkey"` } `json:"midurlinfo"` Sip []string `json:"sip"` TestFile2g string `json:"testfile2g"` } `json:"data"` } `json:"req0"` }
func (*SongURLResponseV2) String ¶
func (s *SongURLResponseV2) String() string
Click to show internal directories.
Click to hide internal directories.