mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 08:52:08 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
bd9695e4e4
@ -1,6 +1,9 @@
|
||||
# 更新日志
|
||||
### 2.9.5 | 2018.05.08
|
||||
新增发送私信相关接口
|
||||
### 2.9.7 | 2018.05.10
|
||||
新增歌手分类列表,收藏/取消收藏歌手接口
|
||||
|
||||
### 2.9.6 | 2018.05.08
|
||||
新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口
|
||||
|
||||
### 2.9.4 | 2018.05.04
|
||||
新增热搜接口,更新 banner 接口
|
||||
|
18
app.js
18
app.js
@ -47,6 +47,15 @@ app.use("/artist/desc", require("./router/artists_desc"));
|
||||
//艺术家-mv
|
||||
app.use("/artist/mv", require("./router/artists_mv"));
|
||||
|
||||
// 收藏歌手
|
||||
app.use("/artist/sub", require("./router/artist_sub"));
|
||||
|
||||
// 取消收藏歌手
|
||||
app.use("/artist/unsub", require("./router/artist_unsub"));
|
||||
|
||||
// 歌手分类
|
||||
app.use("/artist/list", require("./router/artist_list"));
|
||||
|
||||
// 获取 banner
|
||||
app.use("/banner", require("./router/banner"));
|
||||
|
||||
@ -155,10 +164,18 @@ app.use("/playlist/detail", require("./router/playlist_detail"));
|
||||
//收藏单曲到歌单,从歌单删除歌曲 op=del,add;pid=歌单id,tracks=歌曲id
|
||||
app.use("/playlist/tracks", require("./router/playlist_tracks"));
|
||||
|
||||
// 热门歌单分类
|
||||
app.use("/playlist/hot", require("./router/playlist_hot"));
|
||||
|
||||
// 全部歌单分类
|
||||
app.use("/playlist/catlist", require("./router/playlist_catlist"));
|
||||
|
||||
// 新建歌单
|
||||
app.use("/playlist/create", require("./router/playlist_create"));
|
||||
|
||||
// 收藏/取消收藏歌单
|
||||
app.use("/playlist/subscribe", require("./router/playlist_subscribe"));
|
||||
|
||||
//推荐节目
|
||||
app.use("/program/recommend", require("./router/program_recommend"));
|
||||
|
||||
@ -256,6 +273,7 @@ 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"));
|
||||
|
149
docs/README.md
149
docs/README.md
@ -15,9 +15,11 @@
|
||||
跨站请求伪造 (CSRF), 伪造请求头 , 调用官方 API
|
||||
|
||||
## 版本新特性
|
||||
### 2.9.7 | 2018.05.10
|
||||
新增歌手分类列表,收藏/取消收藏歌手接口
|
||||
|
||||
### 2.9.5 | 2018.05.08
|
||||
新增发送私信相关接口
|
||||
### 2.9.6 | 2018.05.08
|
||||
新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口
|
||||
|
||||
### 2.9.4 | 2018.05.04
|
||||
新增热搜接口,更新 banner 接口
|
||||
@ -126,6 +128,9 @@ banner 接口 , 增加刷新登录接口 , 增加电台相关接口 , 补充评
|
||||
63. 获取热搜
|
||||
64. 发送私信
|
||||
65. 发送私信歌单
|
||||
66. 新建歌单
|
||||
67. 收藏/取消收藏歌单
|
||||
68. 歌单分类
|
||||
|
||||
## 安装
|
||||
|
||||
@ -389,12 +394,101 @@ 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 信息
|
||||
|
||||
**接口地址 :** `/playlist/catlist`
|
||||
|
||||
|
||||
**调用例子 :** `/playlist/catlist`
|
||||
|
||||
### 热门歌单分类
|
||||
说明 : 调用此接口,可获取歌单分类,包含 category 信息
|
||||
|
||||
**接口地址 :** `/playlist/hot`
|
||||
|
||||
|
||||
**调用例子 :** `/playlist/hot`
|
||||
|
||||
### 歌单 ( 网友精选碟 )
|
||||
|
||||
说明 : 调用此接口 , 可获取网友精选碟歌单
|
||||
|
||||
**可选参数 :** `order`: 可选值为 'new' 和 'hot', 分别对应最新和最热 , 默认为
|
||||
'hot'
|
||||
|
||||
`cat`:`cat`: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为
|
||||
"全部",可从歌单分类接口获取(/playlist/catlist)
|
||||
|
||||
**接口地址 :** `/top/playlist`
|
||||
|
||||
**调用例子 :** `/top/playlist?limit=10&order=new`
|
||||
|
||||
返回数据如下图 :
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
### 获取精品歌单
|
||||
|
||||
说明 : 调用此接口 , 可获取精品歌单
|
||||
|
||||
**可选参数 :** `cat`: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为
|
||||
" 全部 "
|
||||
"全部",可从歌单分类接口获取(/playlist/catlist)
|
||||
|
||||
`limit`: 取出歌单数量 , 默认为 20
|
||||
|
||||
@ -471,7 +565,10 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具
|
||||
|
||||
**必选参数 :** `keywords` : 关键词
|
||||
|
||||
**可选参数 :** `limit` : 返回数量 , 默认为 30 `offset` : 偏移数量,用于分页 , 如
|
||||
**可选参数 :**
|
||||
`limit` : 返回数量 , 默认为 30
|
||||
|
||||
`offset` : 偏移数量,用于分页 , 如
|
||||
: 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
|
||||
|
||||
`type`: 搜索类型;默认为 1 即单曲 , 取值意义 : 1: 单曲 10: 专辑 100: 歌手 1000:
|
||||
@ -491,6 +588,35 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具
|
||||
|
||||
**调用例子 :** `/search/multimatch?keywords= 海阔天空`
|
||||
|
||||
### 新建歌单
|
||||
|
||||
说明 : 调用此接口 , 传入歌单名字可新建歌单
|
||||
|
||||
**必选参数 :** `name` : 歌单名
|
||||
|
||||
**接口地址 :** `/playlist/create`
|
||||
|
||||
**调用例子 :** `/playlist/create?name=测试歌单`
|
||||
|
||||
返回数据如下图:
|
||||

|
||||
|
||||
### 收藏/取消收藏歌单
|
||||
|
||||
说明 : 调用此接口 , 传入类型和歌单 id 可收藏歌单或者取消收藏歌单
|
||||
|
||||
**必选参数 :**
|
||||
`t` : 类型,1:收藏,2:取消收藏
|
||||
`id` : 歌单 id
|
||||
|
||||
**接口地址 :** `/playlist/subscribe`
|
||||
|
||||
**调用例子 :** `/playlist/subscribe?t=1&id=106697785` `/playlist/subscribe?t=2&id=106697785`
|
||||
|
||||
返回数据如下图:
|
||||

|
||||
|
||||
|
||||
### 对歌单添加或删除歌曲
|
||||
|
||||
说明 : 调用此接口 , 可以添加歌曲到歌单或者从歌单删除某首歌曲 ( 需要登录 )
|
||||
@ -843,21 +969,6 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具
|
||||
|
||||

|
||||
|
||||
### 歌单 ( 网友精选碟 )
|
||||
|
||||
说明 : 调用此接口 , 可获取网友精选碟歌单
|
||||
|
||||
**可选参数 :** `order`: 可选值为 'new' 和 'hot', 分别对应最新和最热 , 默认为
|
||||
'hot'
|
||||
|
||||
**接口地址 :** `/top/playlist`
|
||||
|
||||
**调用例子 :** `/top/playlist?limit=10&order=new`
|
||||
|
||||
返回数据如下图 :
|
||||
|
||||

|
||||
|
||||
### 新碟上架
|
||||
|
||||
说明 : 调用此接口 , 可获取新碟上架列表 , 如需具体音乐信息需要调用获取专辑列表接
|
||||
|
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "NeteaseCloudMusicApi",
|
||||
"version": "2.9.5",
|
||||
"version": "2.9.7",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
47
router/artist_list.js
Normal file
47
router/artist_list.js
Normal file
@ -0,0 +1,47 @@
|
||||
//分类歌单
|
||||
const express = require("express");
|
||||
const router = express();
|
||||
const { createWebAPIRequest } = require("../util/util");
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
|
||||
|
||||
// categoryCode 取值
|
||||
|
||||
// 入驻歌手 5001
|
||||
// 华语男歌手 1001
|
||||
// 华语女歌手 1002
|
||||
// 华语组合/乐队 1003
|
||||
// 欧美男歌手 2001
|
||||
// 欧美女歌手 2002
|
||||
// 欧美组合/乐队 2003
|
||||
// 日本男歌手 6001
|
||||
// 日本女歌手 6002
|
||||
// 日本组合/乐队 6003
|
||||
// 韩国男歌手 7001
|
||||
// 韩国女歌手 7002
|
||||
// 韩国组合/乐队 7003
|
||||
// 其他男歌手 4001
|
||||
// 其他女歌手 4002
|
||||
// 其他组合/乐队 4003
|
||||
|
||||
const data = {
|
||||
categoryCode: req.query.cat || "1001",
|
||||
offset: req.query.offset || 0,
|
||||
total: req.query.total ? "true" : "false",
|
||||
limit: req.query.limit || 30
|
||||
};
|
||||
createWebAPIRequest(
|
||||
"music.163.com",
|
||||
"/weapi/artist/list",
|
||||
"POST",
|
||||
data,
|
||||
cookie,
|
||||
music_req => {
|
||||
res.send(music_req);
|
||||
},
|
||||
err => res.status(502).send("fetch error")
|
||||
);
|
||||
});
|
||||
|
||||
module.exports = router;
|
23
router/artist_sub.js
Normal file
23
router/artist_sub.js
Normal file
@ -0,0 +1,23 @@
|
||||
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 data = {
|
||||
artistId: `${req.query.id}`
|
||||
};
|
||||
createWebAPIRequest(
|
||||
"music.163.com",
|
||||
"/weapi/artist/sub",
|
||||
"POST",
|
||||
data,
|
||||
cookie,
|
||||
music_req => {
|
||||
res.send(music_req);
|
||||
},
|
||||
err => res.status(502).send("fetch error")
|
||||
);
|
||||
});
|
||||
|
||||
module.exports = router;
|
24
router/artist_unsub.js
Normal file
24
router/artist_unsub.js
Normal file
@ -0,0 +1,24 @@
|
||||
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 data = {
|
||||
artistId: `${req.query.id}`,
|
||||
artistIds: `[${req.query.id}]`
|
||||
};
|
||||
createWebAPIRequest(
|
||||
"music.163.com",
|
||||
"/weapi/artist/unsub",
|
||||
"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