Introduction
NCMGET Core is the programmatic API layer of the NCMGET (NetEase Cloud Music Getter) project. It provides a single class NCMGET that encapsulates all interactions with the NetEase Cloud Music API, including search, metadata retrieval, audio URL resolution, lyrics fetching, and cover image access.
Architecture Overview
NCMGET follows a layered architecture:
- Core → Utils: The NCMGET class delegates download management to
DLManager, display formatting toDisplay, filename templating toFormat, and browser launching toOpenBrowser. - Core → Server: The HTTP server creates a new NCMGET instance per request and exposes core methods as REST endpoints.
- CLI → Core: Each command instantiates NCMGET and calls the corresponding method.
Key Design Decisions
Single Class Encapsulation
All API interactions are encapsulated within the NCMGET class. There are no separate client objects or service classes — one instance handles everything.
Chainable Configuration
The cookie() and format() methods return this, enabling a fluent configuration style:
JSON String Returns
All data retrieval methods return Promise<string> — the result is a JSON string that you parse yourself with JSON.parse(). This design keeps the core lightweight and lets consumers decide how to handle the data.
Pipeline Data Processing
Internally, the _exec method processes requests through a pipeline:
- Encode — Apply API-specific encryption (e.g.,
netease_eapi) - HTTP — Send the request with retry logic (3 retries, 1s interval)
- Decode — Parse the response (e.g.,
netease_url,netease_lrc) - Format — Extract and structure the data using a dot-path format string
Quick Example
Next Steps
- Getting Started — Install and use NCMGET in your project
- API Reference — Complete method and property documentation
- Types — TypeScript type definitions
- Advanced — Cookie, encryption, and error handling
