From be156c5d22907cd2c007bf0c56ac21bf351d3750 Mon Sep 17 00:00:00 2001 From: kengwang Date: Fri, 2 Sep 2022 13:48:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20API:=20=E4=B9=90=E8=B0=B1?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增: * 获取乐谱列表 * 获取乐谱内容 !!! 请注意, 乐谱内容的 id 为 乐谱 ID, 请不要提交错误 --- docs/README.md | 20 ++++++++++++++++++++ module/sheet_list.js | 20 ++++++++++++++++++++ module/sheet_preview.js | 19 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 module/sheet_list.js create mode 100644 module/sheet_preview.js diff --git a/docs/README.md b/docs/README.md index b9554b5..68c5d8d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3889,6 +3889,26 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` **调用例子:** `/song/wiki/about?id=1958384591` +### 乐谱列表 + +说明: 调用此接口可以获取歌曲的乐谱列表 + +**接口地址:** `/sheet/list` + +**必选参数:** `id`: 歌曲 ID + +**调用例子:** `/sheet/list?id=1815684465` + +### 乐谱内容 + +说明: 调用此接口获取乐谱的内容 + +**接口地址:** `/sheet/preview` + +**必选参数:** `id`: **乐谱** ID + +**调用例子:** `/sheet/list?id=245206` + ## 离线访问此文档 diff --git a/module/sheet_list.js b/module/sheet_list.js new file mode 100644 index 0000000..014e8a6 --- /dev/null +++ b/module/sheet_list.js @@ -0,0 +1,20 @@ +// 乐谱列表 +const crypto = require('crypto') +module.exports = (query, request) => { + const data = { + id: query.id, + abTest: query.ab || 'b' + } + return request( + 'POST', + `https://interface3.music.163.com/eapi/music/sheet/list/v1`, + data, + { + crypto: 'eapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + url: '/api/music/sheet/list/v1', + }, + ) +} diff --git a/module/sheet_preview.js b/module/sheet_preview.js new file mode 100644 index 0000000..905562c --- /dev/null +++ b/module/sheet_preview.js @@ -0,0 +1,19 @@ +// 乐谱预览 +const crypto = require('crypto') +module.exports = (query, request) => { + const data = { + id: query.id, + } + return request( + 'POST', + `https://interface3.music.163.com/eapi//music/sheet/preview/info?id=${query.id}`, + data, + { + crypto: 'eapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + url: '/api//music/sheet/preview/info',// 我没写错! 他们就是这么请求的! + }, + ) +}