提交 1bc8e536 编写于 作者: B binaryify

Merge branch 'master' into test

# 更新日志
### 3.10.0 | 2019.05.08
### 3.12.0 | 2019.05.10
- 增加`私信内容、我的数字专辑`接口
### 3.11.0 | 2019.05.09
- 增加`通知-私信、通知-评论、通知-@我、通知-通知、设置、云盘数据详情`接口
### 3.10.2 | 2019.05.09
- 增加`分享歌曲、歌单、mv、电台、电台节目到动态`接口
### 3.10.1 | 2019.05.08
- 增加转发动态接口
- 增加删除动态接口
### 3.9.0 | 2019.05.03
- 新增 云盘歌曲删除, 热门话题, 电台 - 推荐类型, 电台 - 非热门类型, 电台 - 今日优选, 心动模式/智能播放等接口
......
......@@ -126,6 +126,16 @@
103. 电台 - 今日优选
104. 心动模式/智能播放
105. 转发动态
106. 删除动态
107. 分享歌曲、歌单、mv、电台、电台节目到动态
108. 通知-私信
109. 通知-评论
110. 通知-@我
111. 通知-通知
112. 设置
113. 云盘数据详情
114. 私信内容
115. 我的数字专辑
## 环境要求
......
......@@ -121,6 +121,16 @@
103. 电台 - 今日优选
104. 心动模式/智能播放
105. 转发动态
106. 删除动态
107. 分享歌曲、歌单、mv、电台、电台节目到动态
108. 通知-私信
109. 通知-评论
110. 通知-@我
111. 通知-通知
112. 设置
113. 云盘数据详情
114. 私信内容
115. 我的数字专辑
## 安装
......@@ -231,7 +241,7 @@ $ sudo docker run -d -p 3000:3000 netease-music-api
!> 文档可能会有缓存 , 如果文档版本和 github 上的版本不一致,请清除缓存再查看
!> 由于网易限制,此项目在国外服务器上使用会受到限制,如需解决 , 可使用大陆服务器或者使用代理 , 感谢 [@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/request.js' 的 'headers' 处增加 `X-Real-IP':'211.161.244.70' // 任意国内 IP`
即可解决
### 登录
......@@ -415,38 +425,6 @@ tags:歌单tag
**调用例子 :** `/playlist/update/?id=24381616&name=新歌单&desc=描述&tags=学习`
### 发送私信
说明 : 登陆后调用此接口 , 传入用户 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, 可以获取用户电台
......@@ -518,6 +496,28 @@ tags:歌单tag
![](https://ws4.sinaimg.cn/large/006tNc79gy1g2trwz8o2gj31b20r6t9n.jpg)
![](https://ws3.sinaimg.cn/large/006tNc79gy1g2trxa0vlej319u0gyjrq.jpg)
### 删除用户动态
说明 : 登陆后调用此接口 ,可以删除用户动态
**必选参数 :** `evId` : 动态 id
**接口地址 :** `/event/del`
**调用例子 :** `/event/del?evId=6712917601`
### 分享歌曲、歌单、mv、电台、电台节目到动态
说明 : 登陆后调用此接口 ,可以分享歌曲、歌单、mv、电台、电台节目到动态
**必选参数 :** `id` : 资源 id (歌曲,歌单,mv,电台,电台节目对应 id)
**可选参数 :** `type`: 资源类型,默认歌曲 song,可传 `song`,`playlist`,`mv`,`djradio`,`djprogram`
`msg`: 内容,140 字限制,支持 emoji,@用户名(`/user/follows`接口获取的用户名,用户名后和内容应该有空格),图片暂不支持
**接口地址 :** `/share/resource`
**调用例子 :** `/share/resource?id=1297494209&msg=测试` `/share/resource?type=djradio&id=336355127` `/share/resource?type=djprogram&id=2061034798` `/share/resource?type=djprogram&id=2061034798&msg=测试@binaryify 测试`
### 获取动态评论
说明 : 登陆后调用此接口 , 可以获取动态下评论
......@@ -562,9 +562,9 @@ tags:歌单tag
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值
**接口地址 :** `/act/hot`
**接口地址 :** `/hot/topic`
**调用例子 :** `/act/hot?limit=30&offset=30`
**调用例子 :** `/hot/topic?limit=30&offset=30`
### 心动模式/智能播放
说明 : 调用此接口 , 可获取心动模式/智能播放列表
......@@ -875,6 +875,8 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具
**必选参数 :** `name` : 歌单名
**可选参数 :** `privacy` : 是否设置为隐私歌单,默认否,传'10'则设置成隐私歌单
**接口地址 :** `/playlist/create`
**调用例子 :** `/playlist/create?name=测试歌单`
......@@ -1784,6 +1786,16 @@ MV 数据 , 数据包含 mv 名字 , 歌手 , 发布时间 , mv 视频地址等
**调用例子 :** `/user/cloud`
### 云盘数据详情
说明 : 登陆后调用此接口 , 传入云盘歌曲 id,可获取云盘数据详情
**必选参数 :** `id`: 歌曲id,可多个,用逗号隔开
**接口地址 :** `/user/cloud/detail`
**调用例子 :** `/user/cloud/detail?id=5374627`
### 云盘歌曲删除
说明 : 登陆后调用此接口 , 可删除云盘歌曲
......@@ -1912,6 +1924,133 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`
**调用例子 :** `/dj/program?rid=336355127&limit=40` ( 对应 ' 代码时间 ' 的节目列表 )
### 通知 - 私信
说明 : 登陆后调用此接口 ,可获取私信
**可选参数 :**
`limit` : 返回数量 , 默认为 30
`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
**接口地址 :** `/msg/private`
**调用例子 :** `/msg/private?limit=3`
### 发送私信
说明 : 登陆后调用此接口 , 传入用户 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)
### 私信内容
说明 : 登陆后调用此接口 , 可获取私信内容
**必选参数 :**
`uid` : 用户 id
**可选参数 :**
`limit` : 返回数量 , 默认为 30
`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
**接口地址 :**
`/msg/private/history`
**调用例子 :**
`/msg/private/history?uid=9003` (云音乐小秘书)
### 发送私信(带歌单)
说明 : 登陆后调用此接口 , 传入用户 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)
### 通知 - 评论
说明 : 登陆后调用此接口 ,可获取评论
**必选参数 :** `uid`: 用户 的 id,只能和登录账号的 id 一致
**可选参数 :**
`limit` : 返回数量 , 默认为 30
`before` : 分页参数,取上一页最后一个歌单的 `updateTime` 获取下一页数据
**接口地址 :** `/msg/comments`
**调用例子 :** `/msg/comments?uid=32953014`
### 通知 - @我
说明 : 登陆后调用此接口 ,可获取@我数据
**可选参数 :**
`limit` : 返回数量 , 默认为 30
`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
**接口地址 :** `/msg/forwards`
**调用例子 :** `/msg/forwards?limit=3`
### 通知 - 通知
说明 : 登陆后调用此接口 ,可获取通知
**可选参数 :**
`limit` : 返回数量 , 默认为 30
`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
**接口地址 :** `/msg/notices`
**调用例子 :** `/msg/notices?limit=3`
### 设置
说明 : 登陆后调用此接口 ,可获取用户设置
**接口地址 :** `/setting`
**调用例子 :** `/setting`
### 我的数字专辑
说明 : 登陆后调用此接口 ,可获取我的数字专辑
**接口地址 :** `/digitalAlbum/purchased`
**调用例子 :** `/digitalAlbum/purchased?limit=10`
## 离线访问此文档
此文档同时也是 Progressive Web Apps(PWA), 加入了 serviceWorker, 可离线访问
......
......@@ -10,6 +10,13 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta name="referrer" content="never">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-5159844745975514",
enable_page_level_ads: true
});
</script>
</head>
<body>
<div id="app"></div>
......@@ -27,4 +34,13 @@
navigator.serviceWorker.register('sw.js')
}
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-139996012-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-139996012-1');
</script>
</html>
### 环境
系统:
## 环境
- 系统/平台: <你的系统和平台>
nodejs 版本:
- nodejs 版本: <你的 NodeJS 版本号>
### 出现问题
- API版本:<运行的云音乐 API 的版本号 对应 package.json 里面的 version>
### 重现步骤
## 出现问题
<出现的问题>
### 期待效果
## 重现步骤
<重现步骤>
>重现步骤尽量详细,不能含糊不清
## 期待效果
<现在的效果期待的效果>
>先看文档有没有相关说明
>重现步骤尽量详细,不能含糊不清,包含请求地址和对应参数和操作过程描述
>如果不是提建议,提 issues 如果不照着模版来将不会优先处理或直接关闭
......
// 我的数字专辑
module.exports = (query, request) => {
const data = {
limit: query.limit || 30,
offset: query.offset || 0,
total: true
}
return request(
'POST', `https://music.163.com/api/digitalAlbum/purchased`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}
\ No newline at end of file
// 云盘数据详情(暂时不要使用)
// 删除动态
module.exports = (query, request) => {
const data = {
byids: query.id,
id: query.id
id: query.evId,
}
return request(
'POST', `https://music.163.com/weapi/v1/cloud/get/byids`, data,
'POST', `https://music.163.com/eapi/event/delete`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}
\ No newline at end of file
// 评论
module.exports = (query, request) => {
const data = {
beforeTime: query.beforeTime || "-1",
limit: query.limit || 30,
total: "true",
uid: query.uid
};
// 448109360
return request(
"POST",
`https://music.163.com/api/v1/user/comments/${query.uid}`,
data,
{
crypto: "weapi",
cookie: query.cookie,
proxy: query.proxy
}
);
};
// @我
module.exports = (query, request) => {
const data = {
offset: query.offset || 0,
limit: query.limit || 30,
total: "true"
};
return request("POST", `https://music.163.com/api/forwards/get`, data, {
crypto: "weapi",
cookie: query.cookie,
proxy: query.proxy
});
};
// 通知
module.exports = (query, request) => {
const data = {
offset: query.offset || 0,
limit: query.limit || 30,
total: "true",
};
return request("POST", `https://music.163.com/api/msg/notices`, data, {
crypto: "weapi",
cookie: query.cookie,
proxy: query.proxy
});
};
// 私信
module.exports = (query, request) => {
const data = {
offset: query.offset || 0,
limit: query.limit || 30,
total: "true",
};
return request("POST", `https://music.163.com/api/msg/private/users`, data, {
crypto: "weapi",
cookie: query.cookie,
proxy: query.proxy
});
};
// 私信内容
module.exports = (query, request) => {
const data = {
userId: query.uid,
offset: query.offset || 0,
limit: query.limit || 30,
total: "true"
};
return request(
"POST",
`https://music.163.com/api/msg/private/history`,
data,
{
crypto: "weapi",
cookie: query.cookie,
proxy: query.proxy
}
);
};
// 创建歌单
module.exports = (query, request) => {
query.cookie.os = 'pc'
const data = {
name: query.name
}
return request(
'POST', `https://music.163.com/weapi/playlist/create`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}
\ No newline at end of file
query.cookie.os = "pc";
const data = {
name: query.name,
privacy: query.privacy //0 为普通歌单,10 为隐私歌单
};
return request("POST", `https://music.163.com/weapi/playlist/create`, data, {
crypto: "weapi",
cookie: query.cookie,
proxy: query.proxy
});
};
module.exports = (query, request) => {
const data = {
}
return request(
'POST', `https://music.163.com/api/user/setting`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}
\ No newline at end of file
......@@ -2,8 +2,8 @@
module.exports = (query, request) => {
const data = {
type: "song",
msg: query.msg,
type: query.type || "song", // song,playlist,mv,djprogram,djradio
msg: query.msg || "",
id: query.id || ""
};
return request(
......
......@@ -2,7 +2,7 @@
module.exports = (query, request) => {
const data = {
limit: query.limit || 200,
limit: query.limit || 30,
offset: query.offset || 0
}
return request(
......
// 云盘数据详情
module.exports = (query, request) => {
const id = query.id.replace(/\s/g, "").split(",");
const data = {
songIds: id
};
return request(
"POST",
`https://music.163.com/weapi/v1/cloud/get/byids`,
data,
{ crypto: "weapi", cookie: query.cookie, proxy: query.proxy }
);
};
{
"name": "NeteaseCloudMusicApi",
"version": "3.10.0",
"version": "3.12.0",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
......@@ -12,17 +12,17 @@
"音乐",
"网易云音乐nodejs"
],
"author": "",
"author": "binaryify",
"license": "MIT",
"dependencies": {
"apicache": "^1.2.1",
"express": "^4.16.3",
"apicache": "^1.4.0",
"express": "^4.16.4",
"pac-proxy-agent": "^3.0.0",
"request": "^2.85.0"
"request": "^2.88.0"
},
"devDependencies": {
"intelli-espower-loader": "^1.0.1",
"mocha": "^5.1.1",
"power-assert": "^1.5.0"
"mocha": "^6.1.4",
"power-assert": "^1.6.1"
}
}
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册