14 releases

0.1.13 Aug 18, 2022
0.1.12 Jun 30, 2022
0.1.11 May 22, 2022
0.1.8 Sep 14, 2021
0.1.1 Jul 6, 2021

#889 in #api-client

Download history 14/week @ 2024-09-22

72 downloads per month

MIT license

130KB
3K SLoC

ncmapi-rs

NetEase Cloud Music API for Rust.

Usage

[dependencies]
ncmapi = "0.1"
tokio = { version = "1", features = ["full"] }
use ncmapi::NcmApi;

#[tokio::main]
async fn main() -> std::result::Result<(), Box<dyn std::error:Error>> {
    let api = NcmApi::default();
    let resp = api.cloud_search("mota", None).await;

    let res = resp.unwrap().deserialize_to_implict();
    println!("{:#?}", res);

    Ok(())
}

Document

Most of the functions are self documented. If there is some confusion about the params of a funtion requires, figure out here

How it works

  • api: export api functions.
  • client:
    • takes an ApiRequst, process it into a Request by presenting it with header and encrypt the payload etc. And then send requests to the server, takes the response and then returns the ApiResponse back.
    • cache

Contribute

If you think this package useful, please do make pull requests.

License

MIT

Dependencies

~13–26MB
~408K SLoC