mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 04:32:09 +08:00
commit
d258e900b1
@ -1,4 +1,7 @@
|
||||
# 更新日志
|
||||
### 2.9.8 | 2018.05.10
|
||||
新增歌手分类列表,收藏/取消收藏歌手接口,新增更新用户信息,更新歌单接口
|
||||
|
||||
### 2.9.6 | 2018.05.08
|
||||
新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
[sqaiyan/netmusic-node](https://github.com/sqaiyan/netmusic-node)
|
||||
|
||||
## 版本新特性
|
||||
### 2.9.8 | 2018.05.10
|
||||
新增歌手分类列表,收藏/取消收藏歌手接口,新增更新用户信息,更新歌单接口
|
||||
|
||||
### 2.9.0 | 2018.01.26
|
||||
|
||||
|
17
app.js
17
app.js
@ -202,10 +202,6 @@ app.use("/search/multimatch", require("./router/search_multimatch"));
|
||||
// 搜索 suggest,搜索结果包含单曲,歌手,歌单,mv信息
|
||||
app.use("/search/suggest", require("./router/search_suggest"));
|
||||
|
||||
app.use("/send/text", require("./router/send_text"));
|
||||
|
||||
app.use("/send/playlist", require("./router/send_playlist"));
|
||||
|
||||
//simi ,相似歌单
|
||||
app.use("/simi/playlist", require("./router/simi_playlist"));
|
||||
|
||||
@ -277,6 +273,19 @@ app.use("/user/subcount", require("./router/user_subcount"));
|
||||
|
||||
app.use("/user/record", require("./router/user_playrecord"));
|
||||
|
||||
|
||||
app.use("/user/update", require("./router/user_update"));
|
||||
|
||||
app.use("/send/text", require("./router/send_text"));
|
||||
|
||||
app.use("/send/playlist", require("./router/send_playlist"));
|
||||
|
||||
app.use("/playlist/create", require("./router/playlist_create"));
|
||||
|
||||
app.use("/playlist/subscribe", require("./router/playlist_subscribe"));
|
||||
|
||||
app.use("/playlist/update", require("./router/playlist_update"));
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
app.listen(port, () => {
|
||||
|
@ -15,6 +15,8 @@
|
||||
跨站请求伪造 (CSRF), 伪造请求头 , 调用官方 API
|
||||
|
||||
## 版本新特性
|
||||
### 2.9.8 | 2018.05.10
|
||||
新增歌手分类列表,收藏/取消收藏歌手接口,新增更新用户信息,更新歌单接口
|
||||
|
||||
### 2.9.6 | 2018.05.08
|
||||
新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口
|
||||
@ -276,6 +278,24 @@ Cookies
|
||||
|
||||
**调用例子 :** `/user/subcount`
|
||||
|
||||
### 更新用户信息
|
||||
|
||||
说明 : 登陆后调用此接口 , 传入相关信息,可以更新用户信息
|
||||
|
||||
**必选参数 :**
|
||||
```
|
||||
gender: 性别 0:保密 1:男性 2:女性
|
||||
birthday: 出生日期,时间戳 unix timestamp
|
||||
nickname: 用户昵称
|
||||
province: 省份id
|
||||
city: 城市id
|
||||
signature:用户签名
|
||||
```
|
||||
|
||||
**接口地址 :** `/user/subcount`
|
||||
|
||||
**调用例子 :** `/user/update/?gender=0&signature=测试签名&city=440300&nickname=binary&birthday=1525918298004&province=440000`
|
||||
|
||||
### 获取用户歌单
|
||||
|
||||
说明 : 登陆后调用此接口 , 传入用户 id, 可以获取用户歌单
|
||||
@ -289,6 +309,20 @@ Cookies
|
||||
返回数据如下图 :
|
||||

|
||||
|
||||
### 更新歌单
|
||||
|
||||
说明 : 登陆后调用此接口,可以更新用户歌单
|
||||
参数:
|
||||
```
|
||||
id:歌单id
|
||||
name:歌单名字
|
||||
desc:歌单描述
|
||||
tags:歌单tag
|
||||
```
|
||||
**接口地址 :** `/playlist/update`
|
||||
|
||||
**调用例子 :** `/playlist/update/?id=24381616&name=新歌单&desc=描述&tags=学习`
|
||||
|
||||
### 发送私信
|
||||
|
||||
说明 : 登陆后调用此接口 , 传入用户 id 和要发送的信息, 可以发送私信,返回内容为历史私信,包含带歌单的私信信息(注:不能发送私信给自己)
|
||||
@ -392,6 +426,59 @@ Cookies
|
||||
|
||||
**调用例子 :** `/event`
|
||||
|
||||
### 歌手分类列表
|
||||
说明 : 调用此接口,可获取歌手分类列表
|
||||
**必选参数 :** `cat` : 即 category Code,歌手类型,默认 1001,返回华语男歌手数据
|
||||
**可选参数 :**
|
||||
`limit` : 返回数量 , 默认为 30
|
||||
|
||||
`offset` : 偏移数量,用于分页 , 如
|
||||
: 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
|
||||
category Code 取值:
|
||||
```
|
||||
入驻歌手 5001
|
||||
华语男歌手 1001
|
||||
华语女歌手 1002
|
||||
华语组合/乐队 1003
|
||||
欧美男歌手 2001
|
||||
欧美女歌手 2002
|
||||
欧美组合/乐队 2003
|
||||
日本男歌手 6001
|
||||
日本女歌手 6002
|
||||
日本组合/乐队 6003
|
||||
韩国男歌手 7001
|
||||
韩国女歌手 7002
|
||||
韩国组合/乐队 7003
|
||||
其他男歌手 4001
|
||||
其他女歌手 4002
|
||||
其他组合/乐队 4003
|
||||
```
|
||||
|
||||
**接口地址 :** `/artist/list`
|
||||
|
||||
|
||||
**调用例子 :** `/artist/list?cat=1001`
|
||||
|
||||
返回数据如下图:
|
||||

|
||||
|
||||
### 收藏歌手
|
||||
说明 : 调用此接口,可收藏歌手
|
||||
**必选参数 :** `artistId` : 歌手 id
|
||||
|
||||
**接口地址 :** `/artist/sub`
|
||||
|
||||
**调用例子 :** `/artist/sub?id=6452`
|
||||
|
||||
### 取消收藏歌手
|
||||
说明 : 调用此接口,可取消收藏歌手
|
||||
**必选参数 :** `artistId` : 歌手 id
|
||||
|
||||
**接口地址 :** `/artist/unsub`
|
||||
|
||||
|
||||
**调用例子 :** `/artist/unsub?id=6452`
|
||||
|
||||
### 歌单分类
|
||||
说明 : 调用此接口,可获取歌单分类,包含 category 信息
|
||||
|
||||
@ -510,7 +597,10 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具
|
||||
|
||||
**必选参数 :** `keywords` : 关键词
|
||||
|
||||
**可选参数 :** `limit` : 返回数量 , 默认为 30 `offset` : 偏移数量,用于分页 , 如
|
||||
**可选参数 :**
|
||||
`limit` : 返回数量 , 默认为 30
|
||||
|
||||
`offset` : 偏移数量,用于分页 , 如
|
||||
: 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
|
||||
|
||||
`type`: 搜索类型;默认为 1 即单曲 , 取值意义 : 1: 单曲 10: 专辑 100: 歌手 1000:
|
||||
|
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "NeteaseCloudMusicApi",
|
||||
"version": "2.9.6",
|
||||
"version": "2.9.8",
|
||||
"description": "网易云音乐 NodeJS 版 API",
|
||||
"scripts": {
|
||||
"start": "node app.js",
|
||||
@ -14,17 +14,17 @@
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"apicache": "^1.2.0",
|
||||
"big-integer": "^1.6.26",
|
||||
"express": "^4.16.2",
|
||||
"request": "^2.83.0"
|
||||
"apicache": "^1.2.1",
|
||||
"big-integer": "^1.6.28",
|
||||
"express": "^4.16.3",
|
||||
"request": "^2.85.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^0.14.3",
|
||||
"intelli-espower-loader": "^1.0.1",
|
||||
"lint-staged": "^6.0.1",
|
||||
"mocha": "^5.0.0",
|
||||
"power-assert": "^1.4.4",
|
||||
"prettier": "^1.10.2"
|
||||
"lint-staged": "^7.1.0",
|
||||
"mocha": "^5.1.1",
|
||||
"power-assert": "^1.5.0",
|
||||
"prettier": "^1.12.1"
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ router.get("/", (req, res) => {
|
||||
categoryCode: req.query.cat || "1001",
|
||||
offset: req.query.offset || 0,
|
||||
total: req.query.total ? "true" : "false",
|
||||
limit: req.query.limit || 50
|
||||
limit: req.query.limit || 30
|
||||
};
|
||||
createWebAPIRequest(
|
||||
"music.163.com",
|
||||
|
33
router/playlist_update.js
Normal file
33
router/playlist_update.js
Normal file
@ -0,0 +1,33 @@
|
||||
const express = require("express");
|
||||
const router = express();
|
||||
const { createWebAPIRequest } = require("../util/util");
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
|
||||
const playlist_id = req.query.id;
|
||||
const desc_detail = req.query.desc || "";
|
||||
const tags_detail = req.query.tags || "";
|
||||
const name_detail = req.query.name;
|
||||
const data = {
|
||||
"/api/playlist/desc/update":
|
||||
'{"id":' + playlist_id + ',"desc":"' + desc_detail + '"}',
|
||||
"/api/playlist/tags/update":
|
||||
'{"id":' + playlist_id + ',"tags":"' + tags_detail + '"}',
|
||||
"/api/playlist/update/name":
|
||||
'{"id":' + playlist_id + ',"name":"' + name_detail + '"}',
|
||||
csrf_token: ""
|
||||
};
|
||||
createWebAPIRequest(
|
||||
"music.163.com",
|
||||
"/weapi/batch",
|
||||
"POST",
|
||||
data,
|
||||
cookie,
|
||||
music_req => {
|
||||
res.send(music_req);
|
||||
},
|
||||
err => res.status(502).send("fetch error")
|
||||
);
|
||||
});
|
||||
|
||||
module.exports = router;
|
33
router/user_update.js
Normal file
33
router/user_update.js
Normal file
@ -0,0 +1,33 @@
|
||||
const express = require("express");
|
||||
const router = express();
|
||||
const { createWebAPIRequest } = require("../util/util");
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
|
||||
// 暂时不提供更换头像接口
|
||||
// gender为0表示保密,1为男性,2为女性
|
||||
const gender_type = req.query.gender;
|
||||
// birthday 为unix13位时间戳
|
||||
// province_number and city_number
|
||||
const data = {
|
||||
avatarImgId: "0",
|
||||
birthday: req.query.birthday,
|
||||
city: req.query.city,
|
||||
gender: gender_type,
|
||||
nickname: req.query.nickname,
|
||||
province: req.query.province,
|
||||
signature: req.query.signature,
|
||||
csrf_token: ""
|
||||
};
|
||||
createWebAPIRequest(
|
||||
"music.163.com",
|
||||
"/weapi/user/profile/update",
|
||||
"POST",
|
||||
data,
|
||||
cookie,
|
||||
music_req => res.send(music_req),
|
||||
err => res.status(502).send("fetch error")
|
||||
);
|
||||
});
|
||||
|
||||
module.exports = router;
|
Loading…
x
Reference in New Issue
Block a user