From 737e226471fa2384a6f533e817ab94ac4407b2a8 Mon Sep 17 00:00:00 2001 From: 5unV <31982712+Cinvin@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:55:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=AD=8C=E6=9B=B2=E7=BA=A2=E5=BF=83?= =?UTF-8?q?=E6=95=B0=E9=87=8F,=E6=AD=8C=E6=9B=B2=E9=9F=B3=E8=B4=A8?= =?UTF-8?q?=E8=AF=A6=E6=83=85,=E6=9C=AC=E5=9C=B0=E6=AD=8C=E6=9B=B2?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8C=B9=E9=85=8D=E7=BD=91=E6=98=93=E4=BA=91?= =?UTF-8?q?=E6=AD=8C=E6=9B=B2=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat:本地歌曲文件匹配网易云歌曲信息 feat:歌曲音质详情 feat:歌曲红心数量 --- docs/README.md | 55 +++++++++++++++++++++++++++++++++++++ module/search_match.js | 28 +++++++++++++++++++ module/song_music_detail.js | 19 +++++++++++++ module/song_red_count.js | 19 +++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 module/search_match.js create mode 100644 module/song_music_detail.js create mode 100644 module/song_red_count.js diff --git a/docs/README.md b/docs/README.md index 1171ab6..96ea8d2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -288,6 +288,9 @@ 270. 播客声音搜索 271. 播客声音排序 272. 播客列表详情 +273. 本地歌曲文件匹配网易云歌曲信息 +274. 歌曲音质详情 +275. 歌曲红心数量 ## 安装 @@ -4512,6 +4515,58 @@ qrCodeStatus:20,detailReason:0 验证成功qrCodeStatus:21,detailReason:0 二 **调用例子:** `/summary/annual?year=2022` +### 本地歌曲文件匹配网易云歌曲信息 + +说明: 调用此接口可以为本地歌曲文件搜索匹配歌曲ID、专辑封面等信息 + +**必选参数:** + +`title`: 文件的标题信息,是文件属性里的标题属性,并非文件名 + +`album`: 文件的专辑信息 + +`artist`: 文件的艺术家信息 + +`duration`: 文件的时长,单位为秒 + +`md5`: 文件的md5 + +**接口地址:** `/search/match` + +**调用例子:** `/search/match?title=富士山下&album=&artist=陈奕迅&duration=259.21&md5=bd708d006912a09d827f02e754cf8e56` + +### 歌曲音质详情 + +说明: 调用此接口获取歌曲各个音质的文件信息,与 `获取歌曲详情` 接口相比,多出 `高清环绕声`、`沉浸环绕声`、`超清母带`等音质的信息 + +**必选参数:** + +`id`: 歌曲id + +**接口地址:** `song/music/detail` + +**调用例子:** `song/music/detail?id=2082700997` + +返回字段说明 : +``` +"br": 比特率Bit Rate, +"size": 文件大小, +"vd": Volume Delta, +"sr": 采样率Sample Rate +``` + +### 歌曲红心数量 + +说明: 调用此接口获取歌曲的红心用户数量 + +**必选参数:** + +`id`: 歌曲id + +**接口地址:** `/song/red/count` + +**调用例子:** `/song/red/count?id=186016` + ## 离线访问此文档 此文档同时也是 Progressive Web Apps(PWA), 加入了 serviceWorker, 可离线访问 diff --git a/module/search_match.js b/module/search_match.js new file mode 100644 index 0000000..b8adf10 --- /dev/null +++ b/module/search_match.js @@ -0,0 +1,28 @@ +// 本地歌曲匹配音乐信息 + +module.exports = (query, request) => { + let songs = [ + { + title: query.title || '', + album: query.album || '', + artist: query.artist || '', + duration: query.duration || 0, + persistId: query.md5, + }, + ] + const data = { + songs: JSON.stringify(songs), + } + return request( + 'POST', + `https://interface3.music.163.com/eapi/search/match/new`, + data, + { + crypto: 'eapi', + cookie: query.cookie, + proxy: query.proxy, + url: '/api/search/match/new', + realIP: query.realIP, + }, + ) +} diff --git a/module/song_music_detail.js b/module/song_music_detail.js new file mode 100644 index 0000000..f9eba04 --- /dev/null +++ b/module/song_music_detail.js @@ -0,0 +1,19 @@ +// 歌曲音质详情 + +module.exports = (query, request) => { + const data = { + songId: query.id, + } + return request( + 'POST', + `https://interface3.music.163.com/eapi/song/music/detail/get`, + data, + { + crypto: 'eapi', + cookie: query.cookie, + proxy: query.proxy, + url: '/api/song/music/detail/get', + realIP: query.realIP, + }, + ) +} diff --git a/module/song_red_count.js b/module/song_red_count.js new file mode 100644 index 0000000..bde0c30 --- /dev/null +++ b/module/song_red_count.js @@ -0,0 +1,19 @@ +// 歌曲红心数量 + +module.exports = (query, request) => { + const data = { + songId: query.id, + } + return request( + 'POST', + `https://interface3.music.163.com/eapi/song/red/count`, + data, + { + crypto: 'eapi', + cookie: query.cookie, + proxy: query.proxy, + url: '/api/song/red/count', + realIP: query.realIP, + }, + ) +}