tencent

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SongAPI     = "https://c.y.qq.com/v8/fcg-bin/fcg_play_single_song.fcg"
	ArtistAPI   = "https://c.y.qq.com/v8/fcg-bin/fcg_v8_singer_track_cp.fcg"
	AlbumAPI    = "https://c.y.qq.com/v8/fcg-bin/fcg_v8_album_detail_cp.fcg"
	PlaylistAPI = "https://c.y.qq.com/v8/fcg-bin/fcg_v8_playlist_cp.fcg"
)
View Source
const (
	SelfSongDownloadUrl  = "http://dl.stream.qqmusic.qq.com/M500%s.mp3?guid=%s&vkey=%s&fromtag=1"
	ThirdSongDownloadAPI = "https://v1.itooi.cn/tencent/url?id=%s&quality=%d"
)
View Source
const (
	AlbumPicUrl = "https://y.gtimg.cn/music/photo_new/T002R300x300M000%s.jpg"
)
View Source
const (
	MusicExpressAPI = "http://base.music.qq.com/fcgi-bin/fcg_musicexpress.fcg"
)
View Source
const (
	UrlPattern = "/(song|songDetail|singer|album|playsquare)/(\\w+)\\.html"
)

Variables

This section is empty.

Functions

func ExtractMP3List

func ExtractMP3List(songs []Song, savePath string) ([]*resource.MP3, error)

func Parse

func Parse(url string) (req common.MusicRequest, err error)

Types

type Album

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

type AlbumRequest

type AlbumRequest struct {
	Params   map[string]string
	Response AlbumResponse
}

func NewAlbumRequest

func NewAlbumRequest(mid string) *AlbumRequest

func (*AlbumRequest) Do

func (s *AlbumRequest) Do() error

func (*AlbumRequest) Extract

func (a *AlbumRequest) Extract() ([]*resource.MP3, error)

type AlbumResponse

type AlbumResponse struct {
	Code int
	Data struct {
		GetAlbumInfo GetAlbumInfo `json:"getAlbumInfo"`
		GetSongInfo  []Song       `json:"getSongInfo"`
	} `json:"data"`
}

type CD

type CD struct {
	DissTid  string `json:"disstid"`
	DissName string `json:"dissname"`
	SongList []Song `json:"songlist"`
}

type GetAlbumInfo

type GetAlbumInfo struct {
	FAlbumId   string `json:"Falbum_id"`
	FAlbumMid  string `json:"Falbum_mid"`
	FAlbumName string `json:"Falbum_name"`
}

type MusicExpress

type MusicExpress struct {
	Code    int      `json:"code"`
	SIP     []string `json:"sip"`
	ThirdIP []string `json:"thirdip"`
	Key     string   `json:"key"`
}

type PlaylistRequest

type PlaylistRequest struct {
	Params   map[string]string
	Response PlaylistResponse
}

func NewPlaylistRequest

func NewPlaylistRequest(id string) *PlaylistRequest

func (*PlaylistRequest) Do

func (s *PlaylistRequest) Do() error

func (*PlaylistRequest) Extract

func (p *PlaylistRequest) Extract() ([]*resource.MP3, error)

type PlaylistResponse

type PlaylistResponse struct {
	Code int `json:"code"`
	Data struct {
		CDList []CD `json:"cdlist"`
	} `json:"data"`
}

type Singer

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

type SingerRequest

type SingerRequest struct {
	Params   map[string]string
	Response SingerResponse
}

func NewSingerRequest

func NewSingerRequest(mid string) *SingerRequest

func (*SingerRequest) Do

func (s *SingerRequest) Do() error

func (*SingerRequest) Extract

func (a *SingerRequest) Extract() ([]*resource.MP3, error)

type SingerResponse

type SingerResponse struct {
	Code int `json:"code"`
	Data struct {
		List []struct {
			MusicData Song `json:"musicData"`
		} `json:"list"`
		SingerId   string `json:"singer_id"`
		SingerMid  string `json:"singer_mid"`
		SingerName string `json:"singer_name"`
		Total      int    `json:"total"`
	} `json:"data"`
}

type Song

type Song struct {
	Id         int      `json:"id"`
	Mid        string   `json:"mid"`
	Name       string   `json:"name"`
	Singer     []Singer `json:"singer"`
	Album      Album    `json:"album"`
	IndexAlbum int      `json:"index_album"`
	TimePublic string   `json:"time_public"`
	Action     struct {
		Switch int `json:"switch"`
	} `json:"action"`
}

func (*Song) Extract

func (s *Song) Extract() *resource.MP3

type SongRequest

type SongRequest struct {
	Params   map[string]string
	Response SongResponse
}

func NewSongRequest

func NewSongRequest(mid string) *SongRequest

func (*SongRequest) Do

func (s *SongRequest) Do() error

func (*SongRequest) Extract

func (s *SongRequest) Extract() ([]*resource.MP3, error)

type SongResponse

type SongResponse struct {
	Code int    `json:"code"`
	Data []Song `json:"data"`
}

Jump to

Keyboard shortcuts

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