converter

package
v0.0.0-...-1d9f23a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	Id       float64 `json:"albumId"`
	Name     string  `json:"album"`
	CoverUrl string  `json:"albumPic"`
}

Album contains all album data.

func (*Album) String

func (a *Album) String() string

type Artist

type Artist struct {
	Name string
	Id   float64
}

func (*Artist) UnmarshalJSON

func (a *Artist) UnmarshalJSON(data []byte) error

type Converter

type Converter struct {
	*ncm.NcmFile
	KeyData   []byte
	MetaData  *Meta
	MusicData []byte
}

Converter converts raw data into formatted data.

func NewConverter

func NewConverter(ncmFile *ncm.NcmFile) *Converter

NewConverter receives a NcmFile pointer and returns a converter pointer. NcmFile provides raw data.

func (*Converter) HandleAll

func (c *Converter) HandleAll() error

func (*Converter) HandleKey

func (c *Converter) HandleKey() error

HandleKey uses aes128 decrypt raw key and stores decrypted key into converter

func (*Converter) HandleMeta

func (c *Converter) HandleMeta() error

HandleMeta uses aes128 decrypt raw meta data, and parse it into struct Meta stored in converter.

func (*Converter) HandleMusic

func (c *Converter) HandleMusic() error

HandleMusic using resolved key parses music data.

type Meta

type Meta struct {
	Id       float64  `json:"musicId"`
	Name     string   `json:"musicName"`
	Album    *Album   `json:"-"`
	Artists  []Artist `json:"artist"`
	BitRate  float64  `json:"bitrate"`
	Duration float64  `json:"duration"`
	Format   string   `json:"format"`
	Comment  string   `json:"-"`
}

Meta contains all meta data transform from meta data in json.

func (*Meta) String

func (m *Meta) String() string

Jump to

Keyboard shortcuts

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