[feat]<api/lyric>: 添加逐字歌词接口

This commit is contained in:
Kengwang 2023-01-07 22:07:58 +08:00 committed by GitHub
parent 985a054658
commit 912998b212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 0 deletions

View File

@ -1625,6 +1625,21 @@ tags: 歌单标签
返回数据如下图 :
![获取歌词](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/%E6%AD%8C%E8%AF%8D.png)
### 获取逐字歌词
说明 : 此接口的 `yrc` 字段即为逐字歌词 (可能有歌曲不包含逐字歌词)
**必选参数 :** `id`: 音乐 id
**接口地址 :** `/lyric_new`
**调用例子 :** `/lyric_new?id=1824020871`
相关讨论可见: [Issue](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1667)
### 新歌速递
说明 : 调用此接口 , 可获取新歌速递

4
interface.d.ts vendored
View File

@ -712,6 +712,10 @@ export function lyric(
params: { id: string | number } & RequestBaseConfig,
): Promise<Response>
export function lyric_new(
params: { id: string | number } & RequestBaseConfig,
): Promise<Response>
export function msg_comments(
params: {
uid: string | number

28
module/lyric_new.js Normal file
View File

@ -0,0 +1,28 @@
// 新版歌词 - 包含逐字歌词
module.exports = (query, request) => {
const data = {
id: query.id,
cp: false,
tv: 0,
lv: 0,
rv: 0,
kv: 0,
yv: 0,
ytv: 0,
yrv: 0
}
return request(
'POST',
`https://interface3.music.163.com/eapi/song/lyric/v1`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/song/lyric/v1'
},
)
}