ncmctl

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(source string) (string, int64, error)

Types

type Cloud

type Cloud struct {
	// contains filtered or unexported fields
}

func NewCloud

func NewCloud(root *Root, l *log.Logger) *Cloud

func (*Cloud) Add

func (c *Cloud) Add(command ...*cobra.Command)

func (*Cloud) Command

func (c *Cloud) Command() *cobra.Command

type CloudOpts

type CloudOpts struct {
	Parallel int64  // 并发上传文件数量
	MinSize  string // 上传文件最低大小限制
	Regexp   string // 上传过滤正则表达式
}

type Crypto

type Crypto struct {
	// contains filtered or unexported fields
}

func NewCrypto

func NewCrypto(root *Root, l *log.Logger) *Crypto

func (*Crypto) Add

func (c *Crypto) Add(command ...*cobra.Command)

func (*Crypto) Command

func (c *Crypto) Command() *cobra.Command

type CryptoOpts

type CryptoOpts struct {
	Output string // 生成文件路径
	Kind   string // api类型
}

type Curl

type Curl struct {
	// contains filtered or unexported fields
}

func NewCurl

func NewCurl(root *Root, l *log.Logger) *Curl

func (*Curl) Add

func (c *Curl) Add(command ...*cobra.Command)

func (*Curl) Command

func (c *Curl) Command() *cobra.Command

type CurlOpts

type CurlOpts struct {
	Method  string        // 请求方法
	Data    string        // 参数内容
	Output  string        // 生成文件路径
	Kind    string        // api类型
	Timeout time.Duration // 超时时间
}

type Download

type Download struct {
	// contains filtered or unexported fields
}

func NewDownload

func NewDownload(root *Root, l *log.Logger) *Download

func (*Download) Add

func (c *Download) Add(command ...*cobra.Command)

func (*Download) Command

func (c *Download) Command() *cobra.Command

type DownloadOpts

type DownloadOpts struct {
	Output   string // 输出目录
	Parallel int64  // 并发下载数量
	Level    string // 歌曲品质 types.Level
	Strict   bool   // 严格模式。当开起时指定的歌曲品质不符合要求,则不进行下载
	Tag      bool
}

type Login

type Login struct {
	// contains filtered or unexported fields
}

func NewLogin

func NewLogin(root *Root, l *log.Logger) *Login

func (*Login) Add

func (c *Login) Add(command ...*cobra.Command)

func (*Login) Command

func (c *Login) Command() *cobra.Command

type LoginOpts

type LoginOpts struct {
	Account string
}

type Logout

type Logout struct {
	// contains filtered or unexported fields
}

func NewLogout

func NewLogout(root *Root, l *log.Logger) *Logout

func (*Logout) Add

func (c *Logout) Add(command ...*cobra.Command)

func (*Logout) Command

func (c *Logout) Command() *cobra.Command

type LogoutOpts

type LogoutOpts struct{}

type Music

type Music struct {
	Id     int64
	Name   string
	Artist []types.Artist
	Album  types.Album
	Time   int64
}

func (Music) ArtistString

func (m Music) ArtistString() string

func (Music) NameString added in v0.0.4

func (m Music) NameString() string

NameString 返回去除特殊符号的歌曲名

func (Music) String

func (m Music) String() string

type NCM

type NCM struct {
	// contains filtered or unexported fields
}

func NewNCM

func NewNCM(root *Root, l *log.Logger) *NCM

func (*NCM) Add

func (c *NCM) Add(command ...*cobra.Command)

func (*NCM) Command

func (c *NCM) Command() *cobra.Command

type NCMOpts

type NCMOpts struct {
	Output   string // 生成文件路径
	Parallel int64
	Tag      bool
}

type NeverHeardSongsList

type NeverHeardSongsList struct {
	Source    string // 资源类型
	SourceId  string // 歌单id
	SongsId   string // 歌单歌曲id
	SongsTime int64  // 歌曲时长
}

type Partner

type Partner struct {
	// contains filtered or unexported fields
}

func NewPartner

func NewPartner(root *Root, l *log.Logger) *Partner

func (*Partner) Add

func (c *Partner) Add(command ...*cobra.Command)

func (*Partner) Command

func (c *Partner) Command() *cobra.Command

type PartnerOpts

type PartnerOpts struct {
	Star    []int64
	ExtStar []int64
	ExtNum  string
}

type Payload

type Payload struct {
	Api      string   `json:"api,omitempty"`
	Method   string   `json:"method,omitempty"`
	Kind     string   `json:"kind,omitempty"`
	Status   string   `json:"status,omitempty"`
	Request  Request  `json:"request,omitempty"`
	Response Response `json:"response,omitempty"`
}

type Request

type Request struct {
	Ciphertext   string `json:"ciphertext,omitempty"`
	RawPlaintext string `json:"rawPlaintext,omitempty"`
	Url          string `json:"url,omitempty"`
	Digest       string `json:"digest,omitempty"`
	Plaintext    string `json:"plaintext,omitempty"`
}

type Response

type Response struct {
	Ciphertext string `json:"ciphertext,omitempty"`
	Plaintext  string `json:"plaintext,omitempty"`
}

type Root

type Root struct {
	Cfg  *config.Config
	Opts RootOpts
	// contains filtered or unexported fields
}

func New

func New() *Root

func (*Root) Add

func (c *Root) Add(command ...*cobra.Command)

func (*Root) Execute

func (c *Root) Execute()

func (*Root) Version

func (c *Root) Version(version, buildTime, commitHash string)

type RootOpts

type RootOpts struct {
	Debug  bool   // 是否开启命令行debug模式
	Config string // 配置文件路径
	Home   string
}

type Scrobble

type Scrobble struct {
	// contains filtered or unexported fields
}

func NewScrobble

func NewScrobble(root *Root, l *log.Logger) *Scrobble

func (*Scrobble) Add

func (c *Scrobble) Add(command ...*cobra.Command)

func (*Scrobble) Command

func (c *Scrobble) Command() *cobra.Command

type ScrobbleOpts

type ScrobbleOpts struct {
	Num int64
}

type SignIn

type SignIn struct {
	// contains filtered or unexported fields
}

func NewSignIn

func NewSignIn(root *Root, l *log.Logger) *SignIn

func (*SignIn) Add

func (c *SignIn) Add(command ...*cobra.Command)

func (*SignIn) Command

func (c *SignIn) Command() *cobra.Command

type SignInOpts

type SignInOpts struct{}

type Task

type Task struct {
	// contains filtered or unexported fields
}

func NewTask

func NewTask(root *Root, l *log.Logger) *Task

func (*Task) Add

func (c *Task) Add(command ...*cobra.Command)

func (*Task) Command

func (c *Task) Command() *cobra.Command

type TaskOpts

type TaskOpts struct {
	Location string
	RunAll   bool

	Partner            bool
	PartnerOptsCrontab string
	PartnerOpts

	Scrobble            bool
	ScrobbleOptsCrontab string
	ScrobbleOpts

	SignIn            bool
	SignInOptsCrontab string
	SignInOpts
}

Jump to

Keyboard shortcuts

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