From ce6e29a7ec0d9daafb0f4a82c42b1fa4f0bb947c Mon Sep 17 00:00:00 2001 From: binaryify Date: Wed, 9 Feb 2022 20:45:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8E=A5=E5=8F=A3=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=90=9C=E7=B4=A2=E5=A3=B0=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 3 +++ docs/README.md | 2 +- module/search.js | 14 ++++++++++++++ package.json | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 2200fdd..820d567 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,7 @@ # 更新日志 +### 4.5.5 | 2022.02.09 +- 搜索接口支持搜索声音 + ### 4.5.4 | 2022.02.09 - 修复云盘上传无法获取到文件的问题 diff --git a/docs/README.md b/docs/README.md index f01fe84..de91c18 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1383,7 +1383,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 : 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 `type`: 搜索类型;默认为 1 即单曲 , 取值意义 : 1: 单曲, 10: 专辑, 100: 歌手, 1000: -歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合 +歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合, 2000:声音(搜索声音返回字段格式会不一样) **接口地址 :** `/search` 或者 `/cloudsearch`(更全) diff --git a/module/search.js b/module/search.js index b2e1ff9..d114aaf 100644 --- a/module/search.js +++ b/module/search.js @@ -1,6 +1,20 @@ // 搜索 module.exports = (query, request) => { + if (query.type && query.type == '2000') { + const data = { + keyword: query.keywords, + scene: 'normal', + limit: query.limit || 30, + offset: query.offset || 0, + } + return request('POST', `https://music.163.com/api/search/voice/get`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) + } const data = { s: query.keywords, type: query.type || 1, // 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频 diff --git a/package.json b/package.json index 06aefed..0661c27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.5.4", + "version": "4.5.5", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js",