fix: expand getUrl API backends for Migu, Netease, GIT plugins

This commit is contained in:
miao-moe
2026-06-20 14:04:12 +08:00
parent f5cc0e3a1a
commit a65463217c
3 changed files with 90 additions and 6 deletions

View File

@@ -307,6 +307,26 @@ function unmsGetUrl(songId, quality) {
})
}
function xhGetUrl(songId, quality) {
var br = mapBr(quality)
var url = 'https://music-api.gdstudio.xyz/api.php?types=url&source=netease&id=' + encodeURIComponent(songId) + '&br=' + br
return httpGet(url, HEADERS_COMMON, 10000).then(function(res) {
if (res && res.url) return { url: res.url, platform: 'wy' }
if (res && res.data && res.data.url) return { url: res.data.url, platform: 'wy' }
throw new Error('no url')
})
}
function nxGetUrl(songId, quality) {
var br = mapBr(quality)
var url = 'https://music.nxinxz.com/kgqq/wy.php?id=' + encodeURIComponent(songId) + '&level=' + br + '&type=mp3'
return httpGet(url, HEADERS_COMMON, 10000).then(function(res) {
if (res && res.url) return { url: res.url, platform: 'wy' }
if (res && res.data && res.data.url) return { url: res.data.url, platform: 'wy' }
throw new Error('no url')
})
}
function getUrl(songId, quality) {
var apis = []
apis.push({ name: 'ceru', fn: ceruGetUrl })
@@ -314,6 +334,8 @@ function getUrl(songId, quality) {
apis.push({ name: 'lx', fn: lxGetUrl })
apis.push({ name: 'ymc', fn: ymcGetUrl })
apis.push({ name: 'unms', fn: unmsGetUrl })
apis.push({ name: 'xh', fn: xhGetUrl })
apis.push({ name: 'nx', fn: nxGetUrl })
apis.push({ name: 'official', fn: wyOfficialUrl })
var promises = []