ncm

package
v0.0.0-...-e23db91 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NcmluTask

func NcmluTask(phone, passwd string, code int, onlySign, unstable bool)

func NewClient

func NewClient() *http.Client

Types

type FeedbackJSON

type FeedbackJSON struct {
	Code int `json:"code"`
}

type Json

type Json struct {
	Download int    `json:"download"`
	End      string `json:"end"`
	ID       int    `json:"id"`
	SourceID string `json:"sourceId"`
	Time     int    `json:"time"`
	Type     string `json:"type"`
	WiFi     int    `json:"wifi"`
}

type Log

type Log struct {
	Action string `json:"action"`
	Json   Json   `json:"json"`
}

type MusicListJSON

type MusicListJSON struct {
	PlayList struct {
		TrackIDs []struct {
			ID int `json:"id"`
		} `json:"trackIds"`
	} `json:"playlist"`
}

type NCMAccount

type NCMAccount struct {
	Phone            string `json:"phone"`       // 用户手机号
	Password         string `json:"password"`    // 用户密码
	CountryCode      int    `json:"countrycode"` // 用户手机号国家码
	Csrf             string // CSRF Token
	Nickname         string // 昵称
	Uid              int    // 用户 UID
	Level            int    // 用户等级
	RemainPlayCount  int    // 剩余播放数量
	RemainLoginCount int    // 剩余登录天数
	PlayList         []int  // 歌单列表
	MusicList        []int  // 歌曲列表
}

func New

func New(phone, password string, code int) *NCMAccount

New return a NCMAccount instance

func (*NCMAccount) Feedback

func (ac *NCMAccount) Feedback(client *http.Client)

func (*NCMAccount) Login

func (ac *NCMAccount) Login(client *http.Client)

Login 登录

func (*NCMAccount) Musics

func (ac *NCMAccount) Musics(client *http.Client, listID int)

Musics 获取某一歌单中的所有歌曲

func (*NCMAccount) PersonalizedList

func (ac *NCMAccount) PersonalizedList(client *http.Client)

PersonalizedList 获取个性化推荐歌单列表

func (*NCMAccount) RecommendList

func (ac *NCMAccount) RecommendList(client *http.Client)

RecommendList 获取每日推荐歌单列表

func (*NCMAccount) Sign

func (ac *NCMAccount) Sign(client *http.Client, tp int)

Sign 签到

func (*NCMAccount) TopPlaylist

func (ac *NCMAccount) TopPlaylist(client *http.Client)

TopPlaylist 获取精选碟歌单

func (*NCMAccount) UserLevel

func (ac *NCMAccount) UserLevel(client *http.Client)

UserLevel 用户等级

type PersonalizedJSON

type PersonalizedJSON struct {
	Code   int `json:"code"`
	Result []struct {
		ID int `json:"id"`
	} `json:"result"`
}

type RecommendJSON

type RecommendJSON struct {
	Code      int `json:"code"`
	Recommend []struct {
		ID int `json:"id"`
	} `json:"recommend"`
}

type ResLevelJSON

type ResLevelJSON struct {
	Code int `json:"code"`
	Data struct {
		Level          int `json:"level"`
		NextLoginCount int `json:"nextLoginCount"`
		NextPlayCount  int `json:"nextPlayCount"`
		NowLoginCount  int `json:"nowLoginCount"`
		NowPlayCount   int `json:"nowPlayCount"`
	} `json:"data"`
}

type ResponseJSON

type ResponseJSON struct {
	Code    int `json:"code"`
	Account struct {
		ID int `json:"id"`
	} `json:"account"`
	Profile struct {
		Nickname string `json:"nickname"`
	} `json:"profile"`
}

type TopListJSON

type TopListJSON struct {
	Playlists []struct {
		ID int `json:"id"`
	} `json:"playlists"`
}

Jump to

Keyboard shortcuts

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