Documentation ¶
Index ¶
- Constants
- func BytesReverse(b []byte) []byte
- func CreateSecretKey(size int, charset string) []byte
- type API
- func (a *API) CellphoneLoginRaw(ctx context.Context, countryCode int, phone int, password string) (*LoginResponse, error)
- func (a *API) EmailLoginRaw(ctx context.Context, email string, password string) (*LoginResponse, error)
- func (a *API) GetAlbum(ctx context.Context, albumId string) (*api.Collection, error)
- func (a *API) GetAlbumRaw(ctx context.Context, albumId int) (*AlbumResponse, error)
- func (a *API) GetArtist(ctx context.Context, artistId string) (*api.Collection, error)
- func (a *API) GetArtistRaw(ctx context.Context, artistId int) (*ArtistResponse, error)
- func (a *API) GetPlaylist(ctx context.Context, playlistId string) (*api.Collection, error)
- func (a *API) GetPlaylistRaw(ctx context.Context, playlistId int) (*PlaylistResponse, error)
- func (a *API) GetSong(ctx context.Context, songId string) (*api.Song, error)
- func (a *API) GetSongLyric(ctx context.Context, songId int) (string, error)
- func (a *API) GetSongLyricRaw(ctx context.Context, songId int) (*SongLyricResponse, error)
- func (a *API) GetSongURL(ctx context.Context, id int, br int) (string, error)
- func (a *API) GetSongsRaw(ctx context.Context, songIds ...int) (*SongsResponse, error)
- func (a *API) GetSongsURLRaw(ctx context.Context, br int, songIds ...int) (*SongURLResponse, error)
- func (a *API) LogoutRaw(ctx context.Context) (*CommonResponse, error)
- func (a *API) RefreshLoginRaw(ctx context.Context) (*CommonResponse, error)
- func (a *API) SearchSongs(ctx context.Context, keyword string) ([]*api.Song, error)
- func (a *API) SearchSongsRaw(ctx context.Context, keyword string, offset int, limit int) (*SearchSongsResponse, error)
- func (a *API) SendRequest(req *ghttp.Request) (*ghttp.Response, error)
- type Album
- type AlbumResponse
- type Artist
- type ArtistResponse
- type CommonResponse
- type LoginResponse
- type PlaylistResponse
- type SearchSongsResponse
- type Song
- type SongLyricResponse
- type SongURL
- type SongURLResponse
- type SongsResponse
Constants ¶
View Source
const ( Base62 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" PresetKey = "0CoJUm6Qyw8W8jud" IV = "0102030405060708" LinuxAPIKey = "rFgB&h#%2?^eDg:Q" EAPIKey = "e82ckenh8dichen8" DefaultRSAPublicKeyModulus = "" /* 256-byte string literal not displayed */ DefaultRSAPublicKeyExponent = 0x10001 )
Variables ¶
This section is empty.
Functions ¶
func BytesReverse ¶
func CreateSecretKey ¶
Types ¶
type API ¶
func (*API) CellphoneLoginRaw ¶
func (a *API) CellphoneLoginRaw(ctx context.Context, countryCode int, phone int, password string) (*LoginResponse, error)
手机登录
func (*API) EmailLoginRaw ¶
func (a *API) EmailLoginRaw(ctx context.Context, email string, password string) (*LoginResponse, error)
邮箱登录
func (*API) GetAlbumRaw ¶
获取专辑
func (*API) GetArtistRaw ¶
获取歌手
func (*API) GetPlaylist ¶
func (*API) GetPlaylistRaw ¶
获取歌单
func (*API) GetSongLyric ¶
func (*API) GetSongLyricRaw ¶
获取歌词
func (*API) GetSongURL ¶
func (*API) GetSongsRaw ¶
批量获取歌曲详情,上限1000首
func (*API) GetSongsURLRaw ¶
批量获取歌曲播放地址,br: 比特率,128/192/320/999
func (*API) RefreshLoginRaw ¶
func (a *API) RefreshLoginRaw(ctx context.Context) (*CommonResponse, error)
刷新登录状态
func (*API) SearchSongs ¶
func (*API) SearchSongsRaw ¶
func (a *API) SearchSongsRaw(ctx context.Context, keyword string, offset int, limit int) (*SearchSongsResponse, error)
搜索歌曲
type AlbumResponse ¶
type AlbumResponse struct { CommonResponse Album Album `json:"album"` Songs []*Song `json:"songs"` }
func (*AlbumResponse) String ¶
func (a *AlbumResponse) String() string
type ArtistResponse ¶
type ArtistResponse struct { CommonResponse Artist struct { Artist } `json:"artist"` HotSongs []*Song `json:"hotSongs"` }
func (*ArtistResponse) String ¶
func (a *ArtistResponse) String() string
type CommonResponse ¶
type LoginResponse ¶
type LoginResponse struct { CommonResponse LoginType int `json:"loginType"` Account struct { Id int `json:"id"` UserName string `json:"userName"` } `json:"account"` }
func (*LoginResponse) String ¶
func (e *LoginResponse) String() string
type PlaylistResponse ¶
type PlaylistResponse struct { CommonResponse Playlist struct { Id int `json:"id"` Name string `json:"name"` PicURL string `json:"coverImgUrl"` Tracks []*Song `json:"tracks"` TrackIds []struct { Id int `json:"id"` } `json:"trackIds"` Total int `json:"trackCount"` } `json:"playlist"` }
func (*PlaylistResponse) String ¶
func (p *PlaylistResponse) String() string
type SearchSongsResponse ¶
type SearchSongsResponse struct { CommonResponse Result struct { Songs []*struct { Id int `json:"id"` Name string `json:"name"` Artists []struct { Id int `json:"id"` Name string `json:"name"` } `json:"artists"` Album struct { Id int `json:"id"` Name string `json:"name"` } `json:"album"` } `json:"songs"` SongCount int `json:"songCount"` } `json:"result"` }
func (*SearchSongsResponse) String ¶
func (s *SearchSongsResponse) String() string
type SongLyricResponse ¶
type SongLyricResponse struct { CommonResponse Lrc struct { Lyric string `json:"lyric"` } `json:"lrc"` TLyric struct { Lyric string `json:"lyric"` } `json:"tlyric"` }
func (*SongLyricResponse) String ¶
func (s *SongLyricResponse) String() string
type SongURLResponse ¶
type SongURLResponse struct { CommonResponse Data []struct { Code int `json:"code"` Id int `json:"id"` BR int `json:"br"` URL string `json:"url"` } `json:"data"` }
func (*SongURLResponse) String ¶
func (s *SongURLResponse) String() string
type SongsResponse ¶
type SongsResponse struct { CommonResponse Songs []*Song `json:"songs"` }
func (*SongsResponse) String ¶
func (s *SongsResponse) String() string
Click to show internal directories.
Click to hide internal directories.