mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 18:22:08 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
a41cb262f2
@ -1,4 +1,7 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
### 2.9.5 | 2018.05.08
|
||||||
|
新增发送私信相关接口
|
||||||
|
|
||||||
### 2.9.4 | 2018.05.04
|
### 2.9.4 | 2018.05.04
|
||||||
新增热搜接口,更新 banner 接口
|
新增热搜接口,更新 banner 接口
|
||||||
|
|
||||||
|
3
app.js
3
app.js
@ -185,6 +185,9 @@ app.use("/search/multimatch", require("./router/search_multimatch"));
|
|||||||
// 搜索 suggest,搜索结果包含单曲,歌手,歌单,mv信息
|
// 搜索 suggest,搜索结果包含单曲,歌手,歌单,mv信息
|
||||||
app.use("/search/suggest", require("./router/search_suggest"));
|
app.use("/search/suggest", require("./router/search_suggest"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//simi ,相似歌单
|
//simi ,相似歌单
|
||||||
app.use("/simi/playlist", require("./router/simi_playlist"));
|
app.use("/simi/playlist", require("./router/simi_playlist"));
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
## 版本新特性
|
## 版本新特性
|
||||||
|
|
||||||
|
### 2.9.5 | 2018.05.08
|
||||||
|
新增发送私信相关接口
|
||||||
|
|
||||||
### 2.9.4 | 2018.05.04
|
### 2.9.4 | 2018.05.04
|
||||||
新增热搜接口,更新 banner 接口
|
新增热搜接口,更新 banner 接口
|
||||||
|
|
||||||
@ -121,6 +124,8 @@ banner 接口 , 增加刷新登录接口 , 增加电台相关接口 , 补充评
|
|||||||
61. 给评论点赞
|
61. 给评论点赞
|
||||||
62. 获取动态
|
62. 获取动态
|
||||||
63. 获取热搜
|
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 会在两分钟内只向网易服务器发一次请求 , 如果遇到不需要缓
|
到 cookie), 相同的 url 会在两分钟内只向网易服务器发一次请求 , 如果遇到不需要缓
|
||||||
存结果的接口 , 可在请求 url 后面加一个时间戳参数使 url 不同 , 例子 :
|
存结果的接口 , 可在请求 url 后面加一个时间戳参数使 url 不同 , 例子 :
|
||||||
`/simi/playlist?id=347230×tamp=1503019930000`
|
`/simi/playlist?id=347230×tamp=1503019930000`
|
||||||
|
|
||||||
* 如果是跨域请求 , 请在所有请求带上 `xhrFields: { withCredentials: true }` 否则
|
!> 如果是跨域请求 , 请在所有请求带上 `xhrFields: { withCredentials: true }` 否则
|
||||||
可能会因为没带上 cookie 导致 301, 具体例子可看 `public/test.html`, 例子使用
|
可能会因为没带上 cookie 导致 301, 具体例子可看 `public/test.html`, 例子使用 jquery, axios 版本也类似
|
||||||
jquery, axios 版本也类似
|
|
||||||
|
|
||||||
* 301 错误基本都是没登录就调用了需要登录的接口 , 如果登陆了还是提示 301, 基本都
|
!> 301 错误基本都是没登录就调用了需要登录的接口,如果登陆了还是提示 301, 基本都是缓存把数据缓存起来了,解决方法是等待 2 分钟或者重启服务重新登录后再调用接口
|
||||||
是缓存把数据缓存起来了 , 解决方法是等待 2 分钟或者重启服务重新登录后再调用接口
|
|
||||||
|
|
||||||
* 部分接口如登录接口不能调用太频繁 , 否则可能会触发 503 错误或者 ip 高频错误 ,
|
!> 部分接口如登录接口不能调用太频繁 , 否则可能会触发 503 错误或者 ip 高频错误 ,若需频繁调用 , 需要准备 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`
|
在 'util.js' 的 'headers' 处增加 `X-Real-IP':'211.161.244.70' // 任意国内 IP`
|
||||||
即可解决
|
即可解决
|
||||||
|
|
||||||
@ -291,6 +286,40 @@ Cookies
|
|||||||
返回数据如下图 :
|
返回数据如下图 :
|
||||||

|

|
||||||
|
|
||||||
|
### 发送私信
|
||||||
|
|
||||||
|
说明 : 登陆后调用此接口 , 传入用户 id 和要发送的信息, 可以发送私信,返回内容为历史私信,包含带歌单的私信信息(注:不能发送私信给自己)
|
||||||
|
|
||||||
|
**必选参数 :**
|
||||||
|
|
||||||
|
`user_ids` : 用户 id,多个需用逗号隔开
|
||||||
|
|
||||||
|
`msg` : 要发送的信息
|
||||||
|
|
||||||
|
|
||||||
|
**接口地址 :** `/send/text`
|
||||||
|
|
||||||
|
**调用例子 :** `/send/text?user_ids=32953014&msg=test`,`/send/text?user_ids=32953014,475625142&msg=test`
|
||||||
|
返回数据如下图:
|
||||||
|

|
||||||
|
|
||||||
|
### 发送私信(带歌单)
|
||||||
|
|
||||||
|
说明 : 登陆后调用此接口 , 传入用户 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`
|
||||||
|
返回数据如下图:
|
||||||
|

|
||||||
|
|
||||||
### 获取用户电台
|
### 获取用户电台
|
||||||
|
|
||||||
说明 : 登陆后调用此接口 , 传入用户 id, 可以获取用户电台
|
说明 : 登陆后调用此接口 , 传入用户 id, 可以获取用户电台
|
||||||
@ -602,7 +631,7 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具
|
|||||||
|
|
||||||
### 获取歌曲详情
|
### 获取歌曲详情
|
||||||
|
|
||||||
说明 : 调用此接口 , 传入音乐 id, 可获得歌曲详情
|
说明 : 调用此接口 , 传入音乐 id, 可获得歌曲详情(注意:歌曲封面现在需要通过专辑内容接口获取)
|
||||||
|
|
||||||
**必选参数 :** `ids`: 音乐 id, 如 `ids=347230`
|
**必选参数 :** `ids`: 音乐 id, 如 `ids=347230`
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "NeteaseCloudMusicApi",
|
"name": "NeteaseCloudMusicApi",
|
||||||
"version": "2.9.4",
|
"version": "2.9.5",
|
||||||
"description": "网易云音乐 NodeJS 版 API",
|
"description": "网易云音乐 NodeJS 版 API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
|
@ -9,7 +9,7 @@ router.get("/", (req, res) => {
|
|||||||
id: req.query.playlist,
|
id: req.query.playlist,
|
||||||
type: "playlist",
|
type: "playlist",
|
||||||
msg: req.query.msg,
|
msg: req.query.msg,
|
||||||
userIds: user_ids,
|
userIds: "[" + user_ids + "]",
|
||||||
csrf_token: ""
|
csrf_token: ""
|
||||||
};
|
};
|
||||||
createWebAPIRequest(
|
createWebAPIRequest(
|
||||||
|
@ -9,9 +9,10 @@ router.get("/", (req, res) => {
|
|||||||
const data = {
|
const data = {
|
||||||
type: "text",
|
type: "text",
|
||||||
msg: req.query.msg,
|
msg: req.query.msg,
|
||||||
userIds: user_ids,
|
userIds: "[" + user_ids + "]",
|
||||||
csrf_token: ""
|
csrf_token: ""
|
||||||
};
|
};
|
||||||
|
console.log(data);
|
||||||
createWebAPIRequest(
|
createWebAPIRequest(
|
||||||
"music.163.com",
|
"music.163.com",
|
||||||
`/weapi/msg/private/send`,
|
`/weapi/msg/private/send`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user