From 2bed2a6b5216ec0bb0c46ccb9a38b84ac8908064 Mon Sep 17 00:00:00 2001 From: binaryify Date: Fri, 4 May 2018 23:04:16 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=83=AD=E6=90=9C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3,=E6=9B=B4=E6=96=B0=20banner=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 3 +++ docs/README.md | 4 ++-- package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 818aabf..ad01de0 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,7 @@ # 更新日志 +### 2.9.4 | 2018.05.04 +新增热搜接口,更新 banner 接口 + ### 2.9.2 | 2018.02.28 修复登录失败会崩溃的问题 diff --git a/docs/README.md b/docs/README.md index 4a0b6c9..8fb4789 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,8 +16,8 @@ ## 版本新特性 -### 2.9.3 | 2018.05.04 -增加热搜接口 +### 2.9.4 | 2018.05.04 +新增热搜接口,更新 banner 接口 ### 2.9.0 | 2018.01.26 diff --git a/package.json b/package.json index 0c26869..35e2fce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "2.9.3", + "version": "2.9.4", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", From 4350f85ccd145446f673ab62afa615ec7016dca5 Mon Sep 17 00:00:00 2001 From: LightStrawberry Date: Sat, 5 May 2018 13:34:33 +0800 Subject: [PATCH 02/10] private msg --- app.js | 4 ++++ router/send_playlist.js | 26 ++++++++++++++++++++++++++ router/send_text.js | 26 ++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 router/send_playlist.js create mode 100644 router/send_text.js diff --git a/app.js b/app.js index c55bb73..addf458 100644 --- a/app.js +++ b/app.js @@ -256,6 +256,10 @@ app.use("/user/subcount", require("./router/user_subcount")); app.use("/user/record", require("./router/user_playrecord")); +app.use("/send/text", require("./router/send_text")); + +app.use("/send/playlist", require("./router/send_playlist")); + const port = process.env.PORT || 3000; app.listen(port, () => { diff --git a/router/send_playlist.js b/router/send_playlist.js new file mode 100644 index 0000000..73de626 --- /dev/null +++ b/router/send_playlist.js @@ -0,0 +1,26 @@ +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 user_ids = req.query.user_ids; + const data = { + id: req.query.playlist, + type: "playlist", + msg: req.query.msg, + userIds: user_ids, + csrf_token: "" + }; + createWebAPIRequest( + "music.163.com", + `/weapi/msg/private/send`, + "POST", + data, + cookie, + music_req => res.send(music_req), + err => res.status(502).send("fetch error") + ); +}); + +module.exports = router; diff --git a/router/send_text.js b/router/send_text.js new file mode 100644 index 0000000..25e534d --- /dev/null +++ b/router/send_text.js @@ -0,0 +1,26 @@ +const express = require("express"); +const router = express(); +const { createWebAPIRequest } = require("../util/util"); + +router.get("/", (req, res) => { + const cookie = req.get("Cookie") ? req.get("Cookie") : ""; + // user_id must be [id] + const user_ids = req.query.user_ids; + const data = { + type: "text", + msg: req.query.msg, + userIds: user_ids, + csrf_token: "" + }; + createWebAPIRequest( + "music.163.com", + `/weapi/msg/private/send`, + "POST", + data, + cookie, + music_req => res.send(music_req), + err => res.status(502).send("fetch error") + ); +}); + +module.exports = router; From b6c3b0591f7cc018aab199e82e36b72faa4ccdd0 Mon Sep 17 00:00:00 2001 From: LightStrawberry Date: Mon, 7 May 2018 23:40:07 +0800 Subject: [PATCH 03/10] playlist_create and playlist_subscribe --- app.js | 4 ++++ router/playlist_create.js | 24 ++++++++++++++++++++++++ router/playlist_subscribe.js | 24 ++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 router/playlist_create.js create mode 100644 router/playlist_subscribe.js diff --git a/app.js b/app.js index addf458..db087d9 100644 --- a/app.js +++ b/app.js @@ -260,6 +260,10 @@ 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")); + const port = process.env.PORT || 3000; app.listen(port, () => { diff --git a/router/playlist_create.js b/router/playlist_create.js new file mode 100644 index 0000000..61abcbb --- /dev/null +++ b/router/playlist_create.js @@ -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 = { + name: req.query.name, + csrf_token: "" + }; + createWebAPIRequest( + "music.163.com", + "/weapi/playlist/create", + "POST", + data, + cookie, + music_req => { + res.send(music_req); + }, + err => res.status(502).send("fetch error") + ); +}); + +module.exports = router; diff --git a/router/playlist_subscribe.js b/router/playlist_subscribe.js new file mode 100644 index 0000000..0463c85 --- /dev/null +++ b/router/playlist_subscribe.js @@ -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 = { + id: req.query.playlist, + csrf_token: "" + }; + createWebAPIRequest( + "music.163.com", + "/weapi/playlist/subscribe", + "POST", + data, + cookie, + music_req => { + res.send(music_req); + }, + err => res.status(502).send("fetch error") + ); +}); + +module.exports = router; From b69f9d37922ab4ee0e5dfe8a8c0236915794510e Mon Sep 17 00:00:00 2001 From: LightStrawberry Date: Mon, 7 May 2018 23:48:53 +0800 Subject: [PATCH 04/10] add unsubscribe and fix args to id --- router/playlist_subscribe.js | 5 +++-- router/send_playlist.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/router/playlist_subscribe.js b/router/playlist_subscribe.js index 0463c85..21c7c12 100644 --- a/router/playlist_subscribe.js +++ b/router/playlist_subscribe.js @@ -5,12 +5,13 @@ const { createWebAPIRequest } = require("../util/util"); router.get("/", (req, res) => { const cookie = req.get("Cookie") ? req.get("Cookie") : ""; const data = { - id: req.query.playlist, + id: req.query.id, csrf_token: "" }; + const action = req.query.t == 1 ? "subscribe" : "unsubscribe"; createWebAPIRequest( "music.163.com", - "/weapi/playlist/subscribe", + `/weapi/playlist/${action}`, "POST", data, cookie, diff --git a/router/send_playlist.js b/router/send_playlist.js index 73de626..29810f9 100644 --- a/router/send_playlist.js +++ b/router/send_playlist.js @@ -6,7 +6,7 @@ router.get("/", (req, res) => { const cookie = req.get("Cookie") ? req.get("Cookie") : ""; const user_ids = req.query.user_ids; const data = { - id: req.query.playlist, + id: req.query.id, type: "playlist", msg: req.query.msg, userIds: user_ids, From df257cde7bac1c8e1334f453f16a3d7df9b36057 Mon Sep 17 00:00:00 2001 From: binaryify Date: Tue, 8 May 2018 10:01:21 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=A7=81=E4=BF=A1=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 3 ++ app.js | 10 ++++--- docs/README.md | 65 +++++++++++++++++++++++++++++------------ package.json | 2 +- router/send_playlist.js | 2 +- router/send_text.js | 3 +- 6 files changed, 60 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index ad01de0..e6b8ae5 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,7 @@ # 更新日志 +### 2.9.5 | 2018.05.08 +新增发送私信相关接口 + ### 2.9.4 | 2018.05.04 新增热搜接口,更新 banner 接口 diff --git a/app.js b/app.js index addf458..5fcb70e 100644 --- a/app.js +++ b/app.js @@ -185,6 +185,12 @@ 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")); @@ -256,10 +262,6 @@ app.use("/user/subcount", require("./router/user_subcount")); app.use("/user/record", require("./router/user_playrecord")); -app.use("/send/text", require("./router/send_text")); - -app.use("/send/playlist", require("./router/send_playlist")); - const port = process.env.PORT || 3000; app.listen(port, () => { diff --git a/docs/README.md b/docs/README.md index 8fb4789..1de9ae2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,6 +16,9 @@ ## 版本新特性 +### 2.9.5 | 2018.05.08 +新增发送私信相关接口 + ### 2.9.4 | 2018.05.04 新增热搜接口,更新 banner 接口 @@ -121,6 +124,8 @@ banner 接口 , 增加刷新登录接口 , 增加电台相关接口 , 补充评 61. 给评论点赞 62. 获取动态 63. 获取热搜 +64. 发送私信 +65. 发送私信歌单 ## 安装 @@ -192,33 +197,23 @@ docker run -d -p 3000:3000 --name netease-cloud-music -e http_proxy= -e https_pr ### 调用前须知 -* 为使用方便 , 降低门槛 , 登录接口直接使用了 get 明文请求 , 请按实际需求对源码修 - 改 +!> 为使用方便,降低门槛,登录接口直接使用了 get 明文请求,请按实际需求对源码修改 -* 由于接口做了缓存处理 ( 缓存 2 分钟 , 可在 app.js 设置 , 可能会导致登陆后获取不 +!> 由于接口做了缓存处理 ( 缓存 2 分钟 , 可在 app.js 设置 , 可能会导致登陆后获取不 到 cookie), 相同的 url 会在两分钟内只向网易服务器发一次请求 , 如果遇到不需要缓 存结果的接口 , 可在请求 url 后面加一个时间戳参数使 url 不同 , 例子 : `/simi/playlist?id=347230×tamp=1503019930000` -* 如果是跨域请求 , 请在所有请求带上 `xhrFields: { withCredentials: true }` 否则 - 可能会因为没带上 cookie 导致 301, 具体例子可看 `public/test.html`, 例子使用 - jquery, axios 版本也类似 +!> 如果是跨域请求 , 请在所有请求带上 `xhrFields: { withCredentials: true }` 否则 + 可能会因为没带上 cookie 导致 301, 具体例子可看 `public/test.html`, 例子使用 jquery, axios 版本也类似 -* 301 错误基本都是没登录就调用了需要登录的接口 , 如果登陆了还是提示 301, 基本都 - 是缓存把数据缓存起来了 , 解决方法是等待 2 分钟或者重启服务重新登录后再调用接口 +!> 301 错误基本都是没登录就调用了需要登录的接口,如果登陆了还是提示 301, 基本都是缓存把数据缓存起来了,解决方法是等待 2 分钟或者重启服务重新登录后再调用接口 -* 部分接口如登录接口不能调用太频繁 , 否则可能会触发 503 错误或者 ip 高频错误 , - 若需频繁调用 , 需要准备 IP 代理池 . +!> 部分接口如登录接口不能调用太频繁 , 否则可能会触发 503 错误或者 ip 高频错误 ,若需频繁调用 , 需要准备 IP 代理池 (更新:已加入缓存机制,但仍需注意). -* 本项目仅供学习使用 , 文档可能会有缓存 , 如果文档版本和 github 上的版本不一致 , - 请清除缓存再查看 +!> 本项目仅供学习使用 , 文档可能会有缓存 , 如果文档版本和 github 上的版本不一致,请清除缓存再查看 -* 2.5.0 版本对部分原有 api 做了微调 , 不过只是调整了下地址 , 参数和返回结果不受 - 影响 - -* 由于网易限制 , 此项目在国外服务器上使用会受到限制 , 如需解决 , 可使用大陆服务 - 器或者使用代理 , 感谢 [@hiyangguo](https://github.com/hiyangguo)提出 - 的[解决方法](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/29#issuecomment-298358438), +!> 由于网易限制,此项目在国外服务器上使用会受到限制,如需解决 , 可使用大陆服务器或者使用代理 , 感谢 [@hiyangguo](https://github.com/hiyangguo)提出的[解决方法](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/29#issuecomment-298358438): 在 'util.js' 的 'headers' 处增加 `X-Real-IP':'211.161.244.70' // 任意国内 IP` 即可解决 @@ -291,6 +286,40 @@ Cookies 返回数据如下图 : ![用户歌单](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/%E7%94%A8%E6%88%B7%E6%AD%8C%E5%8D%95.png) +### 发送私信 + +说明 : 登陆后调用此接口 , 传入用户 id 和要发送的信息, 可以发送私信,返回内容为历史私信,包含带歌单的私信信息(注:不能发送私信给自己) + +**必选参数 :** + +`user_ids` : 用户 id,多个需用逗号隔开 + +`msg` : 要发送的信息 + + +**接口地址 :** `/send/text` + +**调用例子 :** `/send/text?user_ids=32953014&msg=test`,`/send/text?user_ids=32953014,475625142&msg=test` +返回数据如下图: +![数据](https://ws1.sinaimg.cn/large/006tKfTcgy1fr3p3hfeudj31kw1aek2e.jpg) + +### 发送私信(带歌单) + +说明 : 登陆后调用此接口 , 传入用户 id 和要发送的信息和歌单 id, 可以发送带歌单的私信(注:不能发送重复的歌单) + +**必选参数 :** + +`user_ids` : 用户 id,多个需用逗号隔开 + +`msg` : 要发送的信息 + + +**接口地址 :** `/send/playlist` + +**调用例子 :** `/send/playlist?msg=test&user_ids=475625142&playlist=705123491`,`/send/playlist?msg=test2&user_ids=475625142,32953014&playlist=705123493` +返回数据如下图: +![数据](https://ws1.sinaimg.cn/large/006tKfTcgy1fr3p1z7qmcj30v409adg5.jpg) + ### 获取用户电台 说明 : 登陆后调用此接口 , 传入用户 id, 可以获取用户电台 diff --git a/package.json b/package.json index 35e2fce..ef6483a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "2.9.4", + "version": "2.9.5", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/router/send_playlist.js b/router/send_playlist.js index 73de626..3c52b31 100644 --- a/router/send_playlist.js +++ b/router/send_playlist.js @@ -9,7 +9,7 @@ router.get("/", (req, res) => { id: req.query.playlist, type: "playlist", msg: req.query.msg, - userIds: user_ids, + userIds: "[" + user_ids + "]", csrf_token: "" }; createWebAPIRequest( diff --git a/router/send_text.js b/router/send_text.js index 25e534d..f3485a0 100644 --- a/router/send_text.js +++ b/router/send_text.js @@ -9,9 +9,10 @@ router.get("/", (req, res) => { const data = { type: "text", msg: req.query.msg, - userIds: user_ids, + userIds: "[" + user_ids + "]", csrf_token: "" }; + console.log(data); createWebAPIRequest( "music.163.com", `/weapi/msg/private/send`, From 1f53b62ee03e57c703ca8e083283560c6db236de Mon Sep 17 00:00:00 2001 From: binaryify Date: Tue, 8 May 2018 10:16:12 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 1de9ae2..120557d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -631,7 +631,7 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具 ### 获取歌曲详情 -说明 : 调用此接口 , 传入音乐 id, 可获得歌曲详情 +说明 : 调用此接口 , 传入音乐 id, 可获得歌曲详情(注意:歌曲封面现在需要通过专辑内容接口获取) **必选参数 :** `ids`: 音乐 id, 如 `ids=347230` From cf084acb84b718ca323fea1e60738475122dc269 Mon Sep 17 00:00:00 2001 From: Betta <21828604@qq.com> Date: Tue, 8 May 2018 10:35:37 +0800 Subject: [PATCH 07/10] Update send_playlist.js --- router/send_playlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/send_playlist.js b/router/send_playlist.js index 29810f9..73de626 100644 --- a/router/send_playlist.js +++ b/router/send_playlist.js @@ -6,7 +6,7 @@ router.get("/", (req, res) => { const cookie = req.get("Cookie") ? req.get("Cookie") : ""; const user_ids = req.query.user_ids; const data = { - id: req.query.id, + id: req.query.playlist, type: "playlist", msg: req.query.msg, userIds: user_ids, From a8e76255aebf6dc9d3a227812aed6b9d34e2a9bb Mon Sep 17 00:00:00 2001 From: binaryify Date: Tue, 8 May 2018 14:02:52 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=AD=8C=E5=8D=95,=E6=94=B6=E8=97=8F/=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E6=AD=8C=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 4 ++-- app.js | 19 ++++++++++--------- docs/README.md | 35 +++++++++++++++++++++++++++++++++-- package.json | 2 +- 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index e6b8ae5..0b05583 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,6 +1,6 @@ # 更新日志 -### 2.9.5 | 2018.05.08 -新增发送私信相关接口 +### 2.9.6 | 2018.05.08 +新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口 ### 2.9.4 | 2018.05.04 新增热搜接口,更新 banner 接口 diff --git a/app.js b/app.js index 62c22f7..1468482 100644 --- a/app.js +++ b/app.js @@ -155,10 +155,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")); @@ -185,8 +193,9 @@ 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")); @@ -259,14 +268,6 @@ app.use("/user/subcount", require("./router/user_subcount")); app.use("/user/record", require("./router/user_playrecord")); -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")); - const port = process.env.PORT || 3000; app.listen(port, () => { diff --git a/docs/README.md b/docs/README.md index 120557d..b08ffe7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,8 +16,8 @@ ## 版本新特性 -### 2.9.5 | 2018.05.08 -新增发送私信相关接口 +### 2.9.6 | 2018.05.08 +新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口 ### 2.9.4 | 2018.05.04 新增热搜接口,更新 banner 接口 @@ -126,6 +126,8 @@ banner 接口 , 增加刷新登录接口 , 增加电台相关接口 , 补充评 63. 获取热搜 64. 发送私信 65. 发送私信歌单 +66. 新建歌单 +67. 收藏/取消收藏歌单 ## 安装 @@ -491,6 +493,35 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具 **调用例子 :** `/search/multimatch?keywords= 海阔天空` +### 新建歌单 + +说明 : 调用此接口 , 传入歌单名字可新建歌单 + +**必选参数 :** `name` : 歌单名 + +**接口地址 :** `/playlist/create` + +**调用例子 :** `/playlist/create?name=测试歌单` + +返回数据如下图: +![数据](https://ws1.sinaimg.cn/large/006tKfTcgy1fr3va885z5j31a617qwjy.jpg) + +### 收藏/取消收藏歌单 + +说明 : 调用此接口 , 传入类型和歌单 id 可收藏歌单或者取消收藏歌单 + +**必选参数 :** +`t` : 类型,1:收藏,2:取消收藏 +`id` : 歌单 id + +**接口地址 :** `/playlist/subscribe` + +**调用例子 :** `/playlist/subscribe?t=1&id=106697785` `/playlist/subscribe?t=2&id=106697785` + +返回数据如下图: +![数据](https://ws1.sinaimg.cn/large/006tKfTcgy1fr3vdwx0hvj30s405u74b.jpg) + + ### 对歌单添加或删除歌曲 说明 : 调用此接口 , 可以添加歌曲到歌单或者从歌单删除某首歌曲 ( 需要登录 ) diff --git a/package.json b/package.json index ef6483a..8d67b2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "2.9.5", + "version": "2.9.6", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", From becafe67a6d38e6613fb864cfb03a5414771a26d Mon Sep 17 00:00:00 2001 From: binaryify Date: Tue, 8 May 2018 14:19:52 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 ++-- docs/README.md | 53 +++++++++++++++++++++++++++++++++++--------------- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/app.js b/app.js index 1468482..f9f4697 100644 --- a/app.js +++ b/app.js @@ -155,10 +155,10 @@ 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")); // 新建歌单 diff --git a/docs/README.md b/docs/README.md index b08ffe7..ef0d487 100644 --- a/docs/README.md +++ b/docs/README.md @@ -391,12 +391,48 @@ Cookies **调用例子 :** `/event` +### 歌单分类 +说明 : 调用此接口,可获取歌单分类,包含 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` + +返回数据如下图 : + +![精选碟](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/top_playlist.png) +![对应位置](https://ws2.sinaimg.cn/large/006tKfTcgy1fr3wnpyg6jj317e0vcqdc.jpg) +![返回数据](https://ws4.sinaimg.cn/large/006tKfTcgy1fr3wqs5lw9j31ic1re4c4.jpg) + ### 获取精品歌单 说明 : 调用此接口 , 可获取精品歌单 **可选参数 :** `cat`: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为 -" 全部 " +"全部",可从歌单分类接口获取(/playlist/catlist) `limit`: 取出歌单数量 , 默认为 20 @@ -874,21 +910,6 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具 ![移除成功](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/fm_trash.png) -### 歌单 ( 网友精选碟 ) - -说明 : 调用此接口 , 可获取网友精选碟歌单 - -**可选参数 :** `order`: 可选值为 'new' 和 'hot', 分别对应最新和最热 , 默认为 -'hot' - -**接口地址 :** `/top/playlist` - -**调用例子 :** `/top/playlist?limit=10&order=new` - -返回数据如下图 : - -![精选碟](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/top_playlist.png) - ### 新碟上架 说明 : 调用此接口 , 可获取新碟上架列表 , 如需具体音乐信息需要调用获取专辑列表接 From 43bbc4410d7c1287100e6d47a3a9b09cad152626 Mon Sep 17 00:00:00 2001 From: binaryify Date: Tue, 8 May 2018 14:20:14 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index ef0d487..83cee7c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -128,6 +128,7 @@ banner 接口 , 增加刷新登录接口 , 增加电台相关接口 , 补充评 65. 发送私信歌单 66. 新建歌单 67. 收藏/取消收藏歌单 +68. 歌单分类 ## 安装