From 881267c56dbeb562993b3d3a20085602f9c74bc8 Mon Sep 17 00:00:00 2001 From: 1254qwer Date: Sun, 16 Aug 2026 19:08:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20/song/url/v1=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=BB=E9=9F=B3=E5=85=A8=E6=99=AF=E5=A3=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interface.d.ts | 1 + module/song_url_v1.js | 19 +++++++++++++------ public/docs/home.md | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/interface.d.ts b/interface.d.ts index 019ecaa..205e571 100644 --- a/interface.d.ts +++ b/interface.d.ts @@ -1378,6 +1378,7 @@ export const enum SoundQualityType { jyeffect = 'jyeffect', jymaster = 'jymaster', sky = 'sky', + vivid = 'vivid', } export function song_url_v1( diff --git a/module/song_url_v1.js b/module/song_url_v1.js index d5d9c1a..7b178df 100644 --- a/module/song_url_v1.js +++ b/module/song_url_v1.js @@ -1,11 +1,12 @@ // 歌曲链接 - v1 // 此版本不再采用 br 作为音质区分的标准 -// 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), jymaster(超清母带) 进行音质判断 +// 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), vivid(臻音全景声), jymaster(超清母带) 进行音质判断 // 当unblock为true时, 会尝试使用unblockmusic-utils进行解锁, 同时音质设置不会生效, 但仍然为必须传入参数 // 当level为sky时, 可通过 immerseType 选择沉浸声类型, 支持 c51(c51类型)、ste(环绕立体声类型)、aac(aac类型), 默认为 c51 const logger = require('../util/logger.js') const createOption = require('../util/option.js') +const { cookieToJson } = require('../util/index.js') module.exports = async (query, request) => { const { matchID, @@ -16,6 +17,7 @@ module.exports = async (query, request) => { level: query.level, encodeType: 'flac', } + const options = createOption(query, 'xeapi') if (query.unblock === 'true') { try { const result = await matchID(query.id, query.source) @@ -54,9 +56,14 @@ module.exports = async (query, request) => { if (data.level == 'sky') { data.immerseType = query.immerseType || 'c51' } - return request( - `/api/song/enhance/player/url/v1`, - data, - createOption(query, 'xeapi'), - ) + if (data.level == 'vivid') { + data.encodeType = 'mp3' + const cookie = options.cookie + options.cookie = { + ...(typeof cookie === 'string' ? cookieToJson(cookie) : cookie), + os: 'android', + appver: '9.5.61', + } + } + return request(`/api/song/enhance/player/url/v1`, data, options) } diff --git a/public/docs/home.md b/public/docs/home.md index 13b0fb6..59bb1f8 100644 --- a/public/docs/home.md +++ b/public/docs/home.md @@ -1304,14 +1304,14 @@ tags: 歌单标签 **必选参数 :** `id` : 音乐 id `level`: 播放音质等级, 分为 `standard` => `标准`,`higher` => `较高`, `exhigh`=>`极高`, -`lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带` +`lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `vivid` => `臻音全景声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带` `unblock`: 是否使用使用歌曲解锁, 分为`true`和`false` **可选参数 :** `immerseType`: 沉浸声环绕声类型, 分为 `c51` => `c51类型`, `ste` => `环绕立体声类型`, `aac` => `aac类型`, 仅在 `level=sky` 时生效, 默认为 `c51` **接口地址 :** `/song/url/v1` -**调用例子 :** `/song/url/v1?id=1969519579&level=exhigh` `/song/url/v1?id=1969519579,33894312&level=lossless` `/song/url/v1?id=1969519579&level=sky&immerseType=ste` +**调用例子 :** `/song/url/v1?id=1969519579&level=exhigh` `/song/url/v1?id=1969519579,33894312&level=lossless` `/song/url/v1?id=1969519579&level=sky&immerseType=ste` `/song/url/v1?id=1969519579&level=vivid` 说明:`杜比全景声`音质需要设备支持,不同的设备可能会返回不同码率的 url。cookie 需要传入`os=pc`保证返回正常码率的 url。