From 83be4cc744ecb5d10b9c45e6cd4ec7eae1644cd8 Mon Sep 17 00:00:00 2001 From: chen10 <1803012703@qq.com> Date: Thu, 27 May 2021 18:37:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=91=E8=B4=9D=E6=8E=A8?= =?UTF-8?q?=E6=AD=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 25 ++++++++++++++++++++++++- module/yunbei_rcmd_song.js | 22 ++++++++++++++++++++++ module/yunbei_rcmd_song_history.js | 22 ++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 module/yunbei_rcmd_song.js create mode 100644 module/yunbei_rcmd_song_history.js diff --git a/docs/README.md b/docs/README.md index dff821b..c30ff9e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1201,7 +1201,7 @@ tags: 歌单标签 **可选参数 :** `order`: 可选值为 'new' 和 'hot', 分别对应最新和最热 , 默认为 'hot' -`cat`:`cat`: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为 +`cat`: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为 "全部",可从歌单分类接口获取(/playlist/catlist) `limit`: 取出歌单数量 , 默认为 50 @@ -3273,6 +3273,29 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` **调用例子 :** 使用GET方式:`/batch?/api/v2/banner/get={"clientType":"pc"}` 使用POST方式传入参数:`{ "/api/v2/banner/get": {"clientType":"pc"} }` +### 云贝推歌 + +说明 : 登录后调用此接口 , 传入歌曲 id, 可以进行云贝推歌 + +**必选参数 :** `id` : 歌曲 id + +**可选参数 :** `reason` : 推歌理由 + +**接口地址 :** `/yunbei/rcmd/song` + +**调用例子 :** `/yunbei/rcmd/song?id=65528` `/yunbei/rcmd/song?id=65528&reason=人间好声音推荐给你听` + +### 云贝推歌历史记录 + +说明 : 登录后调用此接口 , 可以获得云贝推歌历史记录 + +**可选参数 :** `size` : 返回数量 , 默认为 20 + +`cursor` : 返回数据的 cursor, 默认为 '' , 传入上一次返回结果的 cursor,将会返回下一页的数据 + +**接口地址 :** `/yunbei/rcmd/song/history` + +**调用例子 :** `/yunbei/rcmd/song/history?size=10` ## 离线访问此文档 diff --git a/module/yunbei_rcmd_song.js b/module/yunbei_rcmd_song.js new file mode 100644 index 0000000..28d14e9 --- /dev/null +++ b/module/yunbei_rcmd_song.js @@ -0,0 +1,22 @@ +// 云贝推歌 + +module.exports = (query, request) => { + const data = { + songId: query.id, + reason: query.reason || '好歌献给你', + scene: '', + fromUserId: -1, + } + return request( + 'POST', + `https://music.163.com/weapi/yunbei/rcmd/song/submit`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) + } + \ No newline at end of file diff --git a/module/yunbei_rcmd_song_history.js b/module/yunbei_rcmd_song_history.js new file mode 100644 index 0000000..f0aacc4 --- /dev/null +++ b/module/yunbei_rcmd_song_history.js @@ -0,0 +1,22 @@ +// 云贝推歌历史记录 + +module.exports = (query, request) => { + const data = { + page: JSON.stringify({ + size: query.size || 20, + cursor: query.cursor || '', + }) + } + return request( + 'POST', + `https://music.163.com/weapi/yunbei/rcmd/song/history/list`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) + } + \ No newline at end of file -- GitLab