Documentation
¶
Index ¶
- Constants
- func Client() provider.API
- func GetAlbum(albumId string) (*provider.Album, error)
- func GetArtist(singerId string) (*provider.Artist, error)
- func GetPlaylist(playlistId string) (*provider.Playlist, error)
- func GetSong(copyrightId string) (*provider.Song, error)
- func GetSongId(copyrightId string) (string, error)
- func GetSongLyric(copyrightId string) (string, error)
- func GetSongPic(songId string) (string, error)
- func GetSongURL(contentId string, br int) string
- 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) (*AlbumResponse, error)
- func (a *API) GetArtist(singerId string) (*provider.Artist, error)
- func (a *API) GetArtistInfoRaw(singerId string) (*ArtistInfoResponse, error)
- func (a *API) GetArtistSongRaw(singerId string, page int, pageSize int) (*ArtistSongResponse, error)
- func (a *API) GetPlaylist(playlistId string) (*provider.Playlist, error)
- func (a *API) GetPlaylistRaw(playlistId string) (*PlaylistResponse, error)
- func (a *API) GetSong(copyrightId string) (*provider.Song, error)
- func (a *API) GetSongId(copyrightId string) (string, error)
- func (a *API) GetSongIdRaw(copyrightId string) (*SongIdResponse, error)
- func (a *API) GetSongLyric(copyrightId string) (string, error)
- func (a *API) GetSongLyricRaw(copyrightId string) (*SongLyricResponse, error)
- func (a *API) GetSongPic(songId string) (string, error)
- func (a *API) GetSongPicRaw(songId string) (*SongPicResponse, error)
- func (a *API) GetSongRaw(songId string) (*SongResponse, error)
- func (a *API) GetSongURL(contentId string, br int) string
- func (a *API) GetSongURLRaw(contentId, resourceType string) (*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 Album
- type AlbumResponse
- type ArtistInfo
- type ArtistInfoResponse
- type ArtistSongResponse
- type CommonResponse
- type ImgItem
- type Playlist
- type PlaylistResponse
- type Song
- type SongIdResponse
- type SongLyricResponse
- type SongPicResponse
- type SongResponse
- type SongSearchResponse
- type SongSearchResult
- type SongURLResponse
Constants ¶
View Source
const ( SearchAPI = "https://app.c.nf.migu.cn/MIGUM2.0/v1.0/content/search_all.do?isCopyright=1&isCorrect=1" GetSongIdAPI = "http://music.migu.cn/v3/api/music/audioPlayer/songs?type=1" GetSongInfo = "https://app.c.nf.migu.cn/MIGUM2.0/v2.0/content/querySongBySongId.do?contentId=0" GetSongPlayInfoAPI = "https://app.c.nf.migu.cn/MIGUM2.0/v2.0/content/listen-url?copyrightId=0&netType=01&toneFlag=HQ" GetSongLyricAPI = "http://music.migu.cn/v3/api/music/audioPlayer/getLyric" GetSongPicAPI = "http://music.migu.cn/v3/api/music/audioPlayer/getSongPic" GetArtistInfoAPI = "https://app.c.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?needSimple=01&resourceType=2002" GetArtistSongAPI = "https://app.c.nf.migu.cn/MIGUM3.0/v1.0/template/singerSongs/release?templateVersion=2" GetAlbumAPI = "https://app.c.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?needSimple=01&resourceType=2003" GetPlaylistAPI = "https://app.c.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?needSimple=01&resourceType=2021" SongPlayURL = "" /* 141-byte string literal not displayed */ SongDefaultBR = 128 )
Variables ¶
This section is empty.
Functions ¶
func GetSongLyric ¶
func GetSongPic ¶
func GetSongURL ¶
func SearchSong ¶
func SearchSong(keyword string) (*provider.SearchResult, error)
Types ¶
type API ¶
func (*API) GetArtistInfoRaw ¶
func (a *API) GetArtistInfoRaw(singerId string) (*ArtistInfoResponse, error)
获取歌手信息
func (*API) GetArtistSongRaw ¶
func (a *API) GetArtistSongRaw(singerId string, page int, pageSize int) (*ArtistSongResponse, error)
获取歌手歌曲,page: 页码;pageSize: 每页数量
func (*API) GetPlaylistRaw ¶
func (a *API) GetPlaylistRaw(playlistId string) (*PlaylistResponse, error)
获取歌单
func (*API) GetSongIdRaw ¶
func (a *API) GetSongIdRaw(copyrightId string) (*SongIdResponse, error)
根据版权id获取歌曲id
func (*API) GetSongLyricRaw ¶
func (a *API) GetSongLyricRaw(copyrightId string) (*SongLyricResponse, error)
获取歌词
func (*API) GetSongPicRaw ¶
func (a *API) GetSongPicRaw(songId string) (*SongPicResponse, error)
获取歌曲专辑封面
func (*API) GetSongURLRaw ¶
func (a *API) GetSongURLRaw(contentId, resourceType string) (*SongURLResponse, error)
获取歌曲播放地址
func (*API) SearchSong ¶
func (a *API) SearchSong(keyword string) (*provider.SearchResult, error)
func (*API) SearchSongRaw ¶
搜索歌曲
type AlbumResponse ¶
type AlbumResponse struct {
CommonResponse
Resource []Album `json:"resource"`
}
func GetAlbumRaw ¶
func GetAlbumRaw(albumId string) (*AlbumResponse, error)
func (*AlbumResponse) String ¶
func (a *AlbumResponse) String() string
type ArtistInfo ¶
type ArtistInfoResponse ¶
type ArtistInfoResponse struct {
CommonResponse
Resource []ArtistInfo `json:"resource"`
}
func GetArtistInfoRaw ¶
func GetArtistInfoRaw(singerId string) (*ArtistInfoResponse, error)
func (*ArtistInfoResponse) String ¶
func (a *ArtistInfoResponse) String() string
type ArtistSongResponse ¶
type ArtistSongResponse struct {
CommonResponse
Data struct {
ContentItemList []struct {
ItemList []struct {
Song Song `json:"song"`
} `json:"itemList"`
} `json:"contentItemList"`
} `json:"data"`
}
func GetArtistSongRaw ¶
func GetArtistSongRaw(singerId string, page int, pageSize int) (*ArtistSongResponse, error)
func (*ArtistSongResponse) String ¶
func (a *ArtistSongResponse) String() string
type CommonResponse ¶
type PlaylistResponse ¶
type PlaylistResponse struct {
CommonResponse
Resource []Playlist `json:"resource"`
}
func GetPlaylistRaw ¶
func GetPlaylistRaw(playlistId string) (*PlaylistResponse, error)
func (*PlaylistResponse) String ¶
func (p *PlaylistResponse) String() string
type Song ¶
type Song struct {
ResourceType string `json:"resourceType"`
ContentId string `json:"contentId"`
CopyrightId string `json:"copyrightId"`
SongId string `json:"songId"`
SongName string `json:"songName"`
SingerId string `json:"singerId"`
Singer string `json:"singer"`
AlbumId string `json:"albumId"`
Album string `json:"album"`
AlbumImgs []ImgItem `json:"albumImgs"`
LrcURL string `json:"lrcUrl"`
PicURL string `json:"-"`
Lyric string `json:"-"`
URL string `json:"-"`
}
type SongIdResponse ¶
type SongIdResponse struct {
ReturnCode string `json:"returnCode"`
Msg string `json:"msg,omitempty"`
Items []struct {
SongId string `json:"songId"`
} `json:"items"`
}
func GetSongIdRaw ¶
func GetSongIdRaw(copyrightId string) (*SongIdResponse, error)
func (*SongIdResponse) String ¶
func (s *SongIdResponse) String() string
type SongLyricResponse ¶
type SongLyricResponse struct {
ReturnCode string `json:"returnCode"`
Msg string `json:"msg"`
Lyric string `json:"lyric"`
}
func GetSongLyricRaw ¶
func GetSongLyricRaw(copyrightId string) (*SongLyricResponse, error)
func (*SongLyricResponse) String ¶
func (s *SongLyricResponse) String() string
type SongPicResponse ¶
type SongPicResponse struct {
ReturnCode string `json:"returnCode"`
Msg string `json:"msg"`
SmallPic string `json:"smallPic"`
MediumPic string `json:"mediumPic"`
LargePic string `json:"largePic"`
}
func GetSongPicRaw ¶
func GetSongPicRaw(songId string) (*SongPicResponse, error)
func (*SongPicResponse) String ¶
func (s *SongPicResponse) String() string
type SongResponse ¶
type SongResponse struct {
CommonResponse
Resource []*Song `json:"resource"`
}
func GetSongRaw ¶
func GetSongRaw(songId string) (*SongResponse, error)
func (*SongResponse) String ¶
func (s *SongResponse) String() string
type SongSearchResponse ¶
type SongSearchResponse struct {
CommonResponse
SongResultData struct {
TotalCount string `json:"totalCount"`
Result []*SongSearchResult `json:"result"`
} `json:"songResultData"`
}
func SearchSongRaw ¶
func SearchSongRaw(keyword string, page int, pageSize int) (*SongSearchResponse, error)
func (*SongSearchResponse) String ¶
func (s *SongSearchResponse) String() string
type SongSearchResult ¶
type SongSearchResult struct {
ResourceType string `json:"resourceType"`
ContentId string `json:"contentId"`
CopyrightId string `json:"copyrightId"`
Id string `json:"id"`
Name string `json:"name"`
Singers []struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"singers"`
Albums []struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"albums"`
}
type SongURLResponse ¶
type SongURLResponse struct {
CommonResponse
Data struct {
URL string `json:"url"`
} `json:"data"`
}
func GetSongURLRaw ¶
func GetSongURLRaw(contentId, resourceType string) (*SongURLResponse, error)
func (*SongURLResponse) String ¶
func (s *SongURLResponse) String() string
Click to show internal directories.
Click to hide internal directories.