netease

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WeAPI       = "https://music.163.com/weapi"
	Login       = WeAPI + "/login/cellphone"
	GetSongURL  = WeAPI + "/song/enhance/player/url"
	GetSong     = WeAPI + "/v3/song/detail"
	GetArtist   = WeAPI + "/v1/artist"
	GetAlbum    = WeAPI + "/v1/album"
	GetPlaylist = WeAPI + "/v3/playlist/detail"

	BatchSongsCount = 1000
)
View Source
const (
	Base62                      = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	PresetKey                   = "0CoJUm6Qyw8W8jud"
	IV                          = "0102030405060708"
	DefaultRSAPublicKeyModulus  = "" /* 256-byte string literal not displayed */
	DefaultRSAPublicKeyExponent = 0x10001
)

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(origData []byte) (params, encSecKey string, err error)

Types

type Album

type Album struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	PicURL      string `json:"picURL"`
	PublishTime int64  `json:"publishTime"`
}

type AlbumParams

type AlbumParams struct{}

type AlbumRequest

type AlbumRequest struct {
	Id       int
	Params   AlbumParams
	Response AlbumResponse
}

func NewAlbumRequest

func NewAlbumRequest(id int) *AlbumRequest

func (*AlbumRequest) Do

func (a *AlbumRequest) Do() error

func (*AlbumRequest) Login

func (a *AlbumRequest) Login() error

func (*AlbumRequest) Prepare

func (a *AlbumRequest) Prepare() ([]*provider.MP3, error)

func (*AlbumRequest) RequireLogin

func (a *AlbumRequest) RequireLogin() bool

type AlbumResponse

type AlbumResponse struct {
	SongResponse
	Album Album `json:"album"`
}

type Artist

type Artist struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type ArtistParams

type ArtistParams struct{}

type ArtistRequest

type ArtistRequest struct {
	Id       int
	Params   ArtistParams
	Response ArtistResponse
}

func NewArtistRequest

func NewArtistRequest(id int) *ArtistRequest

func (*ArtistRequest) Do

func (a *ArtistRequest) Do() error

func (*ArtistRequest) Login

func (a *ArtistRequest) Login() error

func (*ArtistRequest) Prepare

func (a *ArtistRequest) Prepare() ([]*provider.MP3, error)

func (*ArtistRequest) RequireLogin

func (a *ArtistRequest) RequireLogin() bool

type ArtistResponse

type ArtistResponse struct {
	Code     int     `json:"code"`
	Msg      string  `json:"msg"`
	Artist   Artist  `json:"artist"`
	HotSongs []*Song `json:"hotSongs"`
}

type LoginParams

type LoginParams struct {
	Phone         string `json:"phone"`
	Password      string `json:"password"`
	RememberLogin bool   `json:"rememberLogin"`
}

type LoginRequest

type LoginRequest struct {
	Params   LoginParams
	Response LoginResponse
}

func NewLoginRequest

func NewLoginRequest(phone, password string) *LoginRequest

func (*LoginRequest) Do

func (l *LoginRequest) Do() error

type LoginResponse

type LoginResponse struct {
	Code      int    `json:"code"`
	Msg       string `json:"msg"`
	LoginType int    `json:"loginType"`
}

type Playlist

type Playlist struct {
	Id       int       `json:"id"`
	Name     string    `json:"name"`
	TrackIds []TrackId `json:"trackIds"`
}

type PlaylistParams

type PlaylistParams struct {
	Id int `json:"id"`
}

type PlaylistRequest

type PlaylistRequest struct {
	Params   PlaylistParams
	Response PlaylistResponse
}

func NewPlaylistRequest

func NewPlaylistRequest(id int) *PlaylistRequest

func (*PlaylistRequest) Do

func (p *PlaylistRequest) Do() error

func (*PlaylistRequest) Login

func (p *PlaylistRequest) Login() error

func (*PlaylistRequest) Prepare

func (p *PlaylistRequest) Prepare() ([]*provider.MP3, error)

func (*PlaylistRequest) RequireLogin

func (p *PlaylistRequest) RequireLogin() bool

type PlaylistResponse

type PlaylistResponse struct {
	Code     int      `json:"code"`
	Msg      string   `json:"msg"`
	Playlist Playlist `json:"playlist"`
}

type Song

type Song struct {
	Id          int      `json:"id"`
	Name        string   `json:"name"`
	Artist      []Artist `json:"ar"`
	Album       Album    `json:"al"`
	Position    int      `json:"no"`
	PublishTime int64    `json:"publishTime"`
}

type SongParams

type SongParams struct {
	C string `json:"c"`
}

type SongRequest

type SongRequest struct {
	Params   SongParams
	Response SongResponse
}

func NewSongRequest

func NewSongRequest(ids ...int) *SongRequest

func (*SongRequest) Do

func (s *SongRequest) Do() error

func (*SongRequest) Login

func (s *SongRequest) Login() error

func (*SongRequest) Prepare

func (s *SongRequest) Prepare() ([]*provider.MP3, error)

func (*SongRequest) RequireLogin

func (s *SongRequest) RequireLogin() bool

type SongResponse

type SongResponse struct {
	Code  int     `json:"code"`
	Msg   string  `json:"msg"`
	Songs []*Song `json:"songs"`
}

type SongURL

type SongURL struct {
	Id   int    `json:"id"`
	Code int    `json:"code"`
	URL  string `json:"url"`
}

type SongURLParams

type SongURLParams struct {
	Ids string `json:"ids"`
	Br  int    `json:"br"`
}

type SongURLRequest

type SongURLRequest struct {
	Params   SongURLParams
	Response SongURLResponse
}

func NewSongURLRequest

func NewSongURLRequest(ids ...int) *SongURLRequest

func (*SongURLRequest) Do

func (s *SongURLRequest) Do() error

type SongURLResponse

type SongURLResponse struct {
	Code int        `json:"code"`
	Msg  string     `json:"msg"`
	Data []*SongURL `json:"data"`
}

type TrackId

type TrackId struct {
	Id int `json:"id"`
}

Jump to

Keyboard shortcuts

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