netease

package
v0.0.0-...-8b0f4ac Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2016 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NEBase            = "http://music.163.com"
	NEApiBase         = NEBase + "/api"
	NESongInfo        = NEApiBase + "/song/detail?ids=[%d]"
	NESongCDN         = "http://m%d.music.126.net/%s/%d.mp3"
	NESongURL         = "http://music.163.com/#/song?id=%d"
	NESearchApiParams = "s=%s&limit=20&type=1&offset=0"
	NERetOK           = 200
	DEBUG             = 1
)

NEBase Netease basic URL NEApiBase Netease Api basic URL

Variables

This section is empty.

Functions

func InitHTTPClient

func InitHTTPClient()
func Search(name string, retSR *base.SearchRet) error

Types

type NeteaseAlbumSubRet

type NeteaseAlbumSubRet struct {
	Name   string `json:"name"`
	ID     int64  `json:"id"`
	PicURL string `json:"picUrl"`
}

NeteaseAlbumSubRet defines a album return structure

type NeteaseArtistSubRet

type NeteaseArtistSubRet struct {
	Name     string `json:"name"`
	ID       int64  `json:"id"`
	PicURL   string `json:"picUrl"`
	Songnum  int64  `json:"musicSize"`
	Albumnum int64  `json:"albumSize"`
}

NeteaseArtistSubRet defines a artist structure for main ret

type NeteaseMusicInfo

type NeteaseMusicInfo struct {
	DfsID   int64 `json:"dfsId"`
	BitRate int64 `json:"bitrate"`
}

NeteaseMusicInfo defines an mp3 file

type NeteaseSearchRet

type NeteaseSearchRet struct {
	Result NeteaseSearchSongResSubRet `json:"result"`
	Code   uint                       `json:"code"`
}

NeteaseSearchRet a structure to receive the search result json

type NeteaseSearchSongResSubRet

type NeteaseSearchSongResSubRet struct {
	SongNum uint                `json:"songCount"`
	Songs   []NeteaseSongSubRet `json:"songs"`
}

type NeteaseSongListRet

type NeteaseSongListRet struct {
	Songs []NeteaseSongSubRet `json:"songs"`
	Code  uint                `json:"code"`
}

NeteaseSongListRet Main return result for json, only Code 200 is OK

type NeteaseSongSubRet

type NeteaseSongSubRet struct {
	Stared   bool                  `json:"starred"`
	Mp3URL   string                `json:"mp3Url"`
	Name     string                `json:"name"`
	ID       int64                 `json:"id"`
	Duration int64                 `json:"duration"`
	Artists  []NeteaseArtistSubRet `json:"artists"`
	HMusic   NeteaseMusicInfo      `json:"hMusic"`
	MMusic   NeteaseMusicInfo      `json:"mMusic"`
	LMusic   NeteaseMusicInfo      `json:"lMusic"`
	Album    NeteaseAlbumSubRet    `json:"album"`
}

NeteaseSongSubRet defines a single song return structure

Jump to

Keyboard shortcuts

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