|
|
1 year ago | |
|---|---|---|
| .github | 1 year ago | |
| .husky | 1 year ago | |
| data | 1 year ago | |
| examples | 1 year ago | |
| module | 1 year ago | |
| module_example | 1 year ago | |
| plugins | 1 year ago | |
| public | 1 year ago | |
| test | 1 year ago | |
| util | 1 year ago | |
| .dockerignore | 1 year ago | |
| .editorconfig | 1 year ago | |
| .eslintrc.js | 1 year ago | |
| .gitignore | 1 year ago | |
| .npmignore | 1 year ago | |
| .prettierrc | 1 year ago | |
| .travis.yml | 1 year ago | |
| CHANGELOG.MD | 1 year ago | |
| Dockerfile | 1 year ago | |
| LICENSE | 1 year ago | |
| README.MD | 1 year ago | |
| app.js | 1 year ago | |
| generateConfig.js | 1 year ago | |
| index.js | 1 year ago | |
| interface.d.ts | 1 year ago | |
| issue_template.md | 1 year ago | |
| main.js | 1 year ago | |
| main.test.js | 1 year ago | |
| package-lock.json | 1 year ago | |
| package.json | 1 year ago | |
| renovate.json | 1 year ago | |
| scf_bootstrap | 1 year ago | |
| server.js | 1 year ago | |
| server.test.js | 1 year ago | |
| tsconfig.json | 1 year ago | |
| vercel.json | 1 year ago | |
| yarn.lock | 1 year ago |
网易云音乐 Node.js API service
需要 NodeJS 14+ 环境
$ git clone git@gitlab.com:Binaryify/NeteaseCloudMusicApi.git
$ cd NeteaseCloudMusicApi
$ npm install
或者
$ git clone https://gitlab.com/Binaryify/NeteaseCloudMusicApi.git
$ cd NeteaseCloudMusicApi
$ npm install
调用前务必阅读文档的调用前须知
$ node app.js
服务器启动默认端口为 3000,若不想使用 3000 端口,可使用以下命令: Mac/Linux
$ PORT=4000 node app.js
windows 下使用 git-bash 或者 cmder 等终端执行以下命令:
$ set PORT=4000 && node app.js
可在终端直接执行
npx NeteaseCloudMusicApi@latest
使用此命令,可直接启动服务,无需下载或者 clone 项目
v4.0.8 加入了 Vercel 配置文件,可以直接在 Vercel 下部署了,不需要自己的服务器
New ProjectImport Git Repository 并选择你 fork 的此项目并点击importPERSONAL ACCOUNT 的 selectContinuePROJECT NAME自己填,FRAMEWORK PRESET 选 Other 然后直接点 Deploy 接着等部署完成即可因 Vercel 在国内访问太慢,在此提供腾讯云 serverless 部署方法(注意:腾讯云 serverless 并不是免费的,前三个月有免费额度,之后收费)
新建应用创建方式选择 Web 应用Express框架,点击底部下一步按钮应用名,上传方式选择代码仓库,进行 GitHub 授权(如已授权可跳过这一步),代码仓库选择刚刚 fork 的项目启动文件填入:
#!/bin/bash
export PORT=9000
/var/lang/node16/bin/node app.js
点击完成,等待部署完成,点击资源列表的 API网关 里的 URL,正常情况会打开文档地址,点击文档例子可查看接口调用效果
v3.31.0 后支持 Node.js 调用,导入的方法为module内的文件名,返回内容包含status和body,status为状态码,body为请求返回内容,参考module_example 文件夹下的 test.js
const { login_cellphone, user_cloud } = require('NeteaseCloudMusicApi')
async function main() {
try {
const result = await login_cellphone({
phone: '手机号',
password: '密码',
})
console.log(result)
const result2 = await user_cloud({
cookie: result.body.cookie, // 凭证
})
console.log(result2.body)
} catch (error) {
console.log(error)
}
}
main()
// test.ts
import { banner } from 'NeteaseCloudMusicApi'
banner({ type: 0 }).then((res) => {
console.log(res)
})
$ npm test
| 语言 | 作者 | 地址 | 类型 |
|---|---|---|---|
| Java | JackuXL | https://github.com/JackuXL/NeteaseCloudMusicApi-SDK | 第三方 |
| Java | 1015770492 | https://github.com/1015770492/yumbo-music-utils | 第三方 |
| Python | 盧瞳 | NeteaseCloudMusic_PythonSDK | 第三方 |