mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
fix: /song/url/v1/302 & /song/download/url/v1 支持臻音全景声
This commit is contained in:
@@ -1,13 +1,23 @@
|
|||||||
// 获取客户端歌曲下载链接 - v1
|
// 获取客户端歌曲下载链接 - v1
|
||||||
// 此版本不再采用 br 作为音质区分的标准
|
// 此版本不再采用 br 作为音质区分的标准
|
||||||
// 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), jymaster(超清母带) 进行音质判断
|
// 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), vivid(臻音全景声), jymaster(超清母带) 进行音质判断
|
||||||
|
|
||||||
const createOption = require('../util/option.js')
|
const createOption = require('../util/option.js')
|
||||||
|
const { cookieToJson } = require('../util/index.js')
|
||||||
module.exports = (query, request) => {
|
module.exports = (query, request) => {
|
||||||
const data = {
|
const data = {
|
||||||
id: query.id,
|
id: query.id,
|
||||||
immerseType: 'c51',
|
immerseType: 'c51',
|
||||||
level: query.level,
|
level: query.level,
|
||||||
}
|
}
|
||||||
return request(`/api/song/enhance/download/url/v1`, data, createOption(query))
|
const options = createOption(query)
|
||||||
|
if (query.level === 'vivid') {
|
||||||
|
const cookie = options.cookie
|
||||||
|
options.cookie = {
|
||||||
|
...(typeof cookie === 'string' ? cookieToJson(cookie) : cookie),
|
||||||
|
os: 'android',
|
||||||
|
appver: '9.5.61',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return request(`/api/song/enhance/download/url/v1`, data, options)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,30 @@
|
|||||||
// 获取客户端歌曲下载链接 - v1
|
// 获取客户端歌曲下载链接 - v1
|
||||||
// 此版本不再采用 br 作为音质区分的标准
|
// 此版本不再采用 br 作为音质区分的标准
|
||||||
// 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), jymaster(超清母带) 进行音质判断
|
// 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), vivid(臻音全景声), jymaster(超清母带) 进行音质判断
|
||||||
|
|
||||||
const createOption = require('../util/option.js')
|
const createOption = require('../util/option.js')
|
||||||
|
const { cookieToJson } = require('../util/index.js')
|
||||||
module.exports = async (query, request) => {
|
module.exports = async (query, request) => {
|
||||||
const data = {
|
const data = {
|
||||||
id: query.id,
|
id: query.id,
|
||||||
immerseType: 'c51',
|
immerseType: 'c51',
|
||||||
level: query.level,
|
level: query.level,
|
||||||
}
|
}
|
||||||
|
const options = createOption(query)
|
||||||
|
if (query.level === 'vivid') {
|
||||||
|
const cookie = options.cookie
|
||||||
|
options.cookie = {
|
||||||
|
...(typeof cookie === 'string' ? cookieToJson(cookie) : cookie),
|
||||||
|
os: 'android',
|
||||||
|
appver: '9.5.61',
|
||||||
|
}
|
||||||
|
}
|
||||||
const response = await request(
|
const response = await request(
|
||||||
`/api/song/enhance/download/url/v1`,
|
`/api/song/enhance/download/url/v1`,
|
||||||
data,
|
data,
|
||||||
createOption(query),
|
options,
|
||||||
)
|
)
|
||||||
let url = response?.body?.data?.[0]?.url
|
let url = response?.body?.data?.url || response?.body?.data?.[0]?.url
|
||||||
|
|
||||||
if (!url) {
|
if (!url) {
|
||||||
const fallbackData = {
|
const fallbackData = {
|
||||||
@@ -25,10 +35,13 @@ module.exports = async (query, request) => {
|
|||||||
if (query.level === 'sky') {
|
if (query.level === 'sky') {
|
||||||
fallbackData.immerseType = 'c51'
|
fallbackData.immerseType = 'c51'
|
||||||
}
|
}
|
||||||
|
if (query.level === 'vivid') {
|
||||||
|
fallbackData.encodeType = 'mp3'
|
||||||
|
}
|
||||||
const fallback = await request(
|
const fallback = await request(
|
||||||
`/api/song/enhance/player/url/v1`,
|
`/api/song/enhance/player/url/v1`,
|
||||||
fallbackData,
|
fallbackData,
|
||||||
createOption(query),
|
options,
|
||||||
)
|
)
|
||||||
url = fallback?.body?.data?.[0]?.url
|
url = fallback?.body?.data?.[0]?.url
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1321,7 +1321,7 @@ tags: 歌单标签
|
|||||||
|
|
||||||
**必选参数 :** `id` : 音乐 id
|
**必选参数 :** `id` : 音乐 id
|
||||||
`level`: 播放音质等级, 分为 `standard` => `标准`,`higher` => `较高`, `exhigh`=>`极高`,
|
`level`: 播放音质等级, 分为 `standard` => `标准`,`higher` => `较高`, `exhigh`=>`极高`,
|
||||||
`lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带`
|
`lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `vivid` => `臻音全景声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带`
|
||||||
`unblock`: 是否使用使用歌曲解锁, 分为`true`和`false`
|
`unblock`: 是否使用使用歌曲解锁, 分为`true`和`false`
|
||||||
|
|
||||||
**接口地址 :** `/song/url/v1/302`
|
**接口地址 :** `/song/url/v1/302`
|
||||||
@@ -4774,7 +4774,7 @@ bitrate = Math.floor(br / 1000)
|
|||||||
|
|
||||||
**必选参数 :** `id` : 音乐 id
|
**必选参数 :** `id` : 音乐 id
|
||||||
`level`: 播放音质等级, 分为 `standard` => `标准`,`higher` => `较高`, `exhigh`=>`极高`,
|
`level`: 播放音质等级, 分为 `standard` => `标准`,`higher` => `较高`, `exhigh`=>`极高`,
|
||||||
`lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带`
|
`lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `vivid` => `臻音全景声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带`
|
||||||
|
|
||||||
**接口地址 :** `/song/download/url/v1`
|
**接口地址 :** `/song/download/url/v1`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user