From 87aa994365c26cc0293ec45064735c3406e29c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=82=A6?= Date: Wed, 14 Jan 2026 17:53:48 +0800 Subject: [PATCH] =?UTF-8?q?getSongUrl=E6=94=B9=E4=B8=BA=E8=BF=94=E5=9B=9Eu?= =?UTF-8?q?rl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 8a157c6..5d7e4ad 100644 --- a/index.html +++ b/index.html @@ -270,8 +270,15 @@ return { results: [], total: 0 }; } }, - getSongUrl: (id, source, br = '320k') => { - return `${API_BASE}?source=${source}&id=${id}&type=url&br=${br}`; + getSongUrl:async (id, source, br = '320k') => { + try { + const res = await fetch(`${API_BASE}?source=${source}&id=${id}&type=url&br=${br}`); + const data = await res.json(); + return data.url; + } catch (e) { + console.error("Get song url failed", e); + return null; + } }, getPicUrl: (id, source) => { return `${API_BASE}?source=${source}&id=${id}&type=pic`;