tencent

package
v0.0.0-...-69f4c14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Client *ghttp.Client
}

func Client

func Client() *API

func New

func New(client *ghttp.Client) *API

func (*API) GetAlbum

func (a *API) GetAlbum(ctx context.Context, albumMid string) (*api.Collection, error)

func (*API) GetAlbumRaw

func (a *API) GetAlbumRaw(ctx context.Context, albumMid string) (*AlbumResponse, error)

获取专辑

func (*API) GetArtist

func (a *API) GetArtist(ctx context.Context, singerMid string) (*api.Collection, error)

func (*API) GetArtistRaw

func (a *API) GetArtistRaw(ctx context.Context, singerMid string, page int, pageSize int) (*ArtistResponse, error)

获取歌手

func (*API) GetPlaylist

func (a *API) GetPlaylist(ctx context.Context, playlistId string) (*api.Collection, error)

func (*API) GetPlaylistRaw

func (a *API) GetPlaylistRaw(ctx context.Context, playlistId string) (*PlaylistResponse, error)

获取歌单

func (*API) GetSong

func (a *API) GetSong(ctx context.Context, songMid string) (*api.Song, error)

func (*API) GetSongLyric

func (a *API) GetSongLyric(ctx context.Context, songMid string) (string, error)

func (*API) GetSongLyricRaw

func (a *API) GetSongLyricRaw(ctx context.Context, songMid string) (*SongLyricResponse, error)

获取歌词

func (*API) GetSongRaw

func (a *API) GetSongRaw(ctx context.Context, songMid string) (*SongResponse, error)

获取歌曲详情

func (*API) GetSongURLV1

func (a *API) GetSongURLV1(ctx context.Context, songMid string, mediaMid string) (string, error)

func (*API) GetSongURLV1Raw

func (a *API) GetSongURLV1Raw(ctx context.Context, songMid string, mediaMid string) (*SongURLResponseV1, error)

获取歌曲播放地址

func (*API) GetSongURLV2

func (a *API) GetSongURLV2(ctx context.Context, songMid string) (string, error)

func (*API) GetSongsURLV2Raw

func (a *API) GetSongsURLV2Raw(ctx context.Context, songMids ...string) (*SongURLResponseV2, error)

批量获取歌曲播放地址

func (*API) SearchSongs

func (a *API) SearchSongs(ctx context.Context, keyword string) ([]*api.Song, error)

func (*API) SearchSongsRaw

func (a *API) SearchSongsRaw(ctx context.Context, keyword string, page int, pageSize int) (*SearchSongsResponse, error)

搜索歌曲

func (*API) SendRequest

func (a *API) SendRequest(req *ghttp.Request) (*ghttp.Response, error)

type Album

type Album struct {
	Mid  string `json:"mid"`
	Name string `json:"name"`
}

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 Singer

type Singer struct {
	Mid  string `json:"mid"`
	Name string `json:"name"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL