From cd17ccfbaaa0796a3c01ac9e1eee8f9326d489c1 Mon Sep 17 00:00:00 2001 From: 7lsu Date: Sat, 27 Feb 2021 14:59:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=81=E4=BF=A1=E4=B8=93?= =?UTF-8?q?=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 19 ++++++++++++++++++- module/send_album.js | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 module/send_album.js diff --git a/docs/README.md b/docs/README.md index 40fed39..cabe9c6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2907,7 +2907,7 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` **调用例子 :** `/send/text?user_ids=32953014&msg=test`,`/send/text?user_ids=32953014,475625142&msg=test` -### 发送私信音乐 +### 发送私信(带歌曲) 说明 : 登录后调用此接口 , 传入用户 id 和要发送的信息,音乐id, 可以发送音乐私信,返回内容为历史私信 @@ -2915,12 +2915,29 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` `user_ids` : 用户 id,多个需用逗号隔开 +`id` : 要发送音乐的id + `msg` : 要发送的信息 **接口地址 :** `/send/song` **调用例子 :** `/send/song?user_ids=1&id=351318&msg=测试` +### 发送私信(带专辑) + +说明 : 登录后调用此接口 , 传入用户 id 和要发送的信息,专辑id, 可以发送专辑私信,返回内容为消息id + +**必选参数 :** + +`user_ids` : 用户 id,多个需用逗号隔开 + +`id` : 要发送专辑的id + +`msg` : 要发送的信息 + +**接口地址 :** `/send/album` + +**调用例子 :** `/send/album?user_ids=1&id=351318&msg=测试` ### 发送私信(带歌单) diff --git a/module/send_album.js b/module/send_album.js new file mode 100644 index 0000000..8af5673 --- /dev/null +++ b/module/send_album.js @@ -0,0 +1,18 @@ +// 私信专辑 + +module.exports = (query, request) => { + query.cookie.os = 'ios' + query.cookie.appver = '8.1.20' + const data = { + id: query.id, + msg: query.msg || '', + type: 'album', + userIds: '[' + query.user_ids + ']', + } + return request('POST', `https://music.163.com/api/msg/private/send`, data, { + crypto: 'api', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +}