From b79f4a8b2cae34a2547851352255e3eb7c1485ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=82=A6?= Date: Wed, 7 Jan 2026 18:08:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B7=A6=E4=B8=8A=E8=A7=92?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=EF=BC=8C=E6=89=93=E5=BC=80=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8F=E3=80=82=20=E7=82=B9=E5=87=BB=E2=80=9C=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=BD=91=E6=98=93=E4=BA=91=E6=AD=8C=E5=8D=95=E2=80=9D?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E3=80=82=20=E7=B2=98=E8=B4=B4=E7=BD=91?= =?UTF-8?q?=E6=98=93=E4=BA=91=E6=AD=8C=E5=8D=95=E5=88=86=E4=BA=AB=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E3=80=82=20=E7=B3=BB=E7=BB=9F=E5=B0=86=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8F=90=E5=8F=96=20ID=EF=BC=8C=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=AD=8C=E6=9B=B2=EF=BC=8C=E5=B9=B6=E5=BC=80=E5=90=AF=E6=AF=8F?= =?UTF-8?q?=2015=20=E5=88=86=E9=92=9F=E4=B8=80=E6=AC=A1=E7=9A=84=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=90=8C=E6=AD=A5=E3=80=82=20=E8=8B=A5=E8=A6=81?= =?UTF-8?q?=E5=88=87=E5=9B=9E=E7=A7=81=E6=9C=89=E4=BA=91=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E9=9C=80=E6=B8=85=E7=A9=BA=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E5=86=85=E5=AE=B9=E6=88=96=E9=87=8D=E6=96=B0=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=82=A8=E7=9A=84=20Server=20Key=20=E5=8D=B3=E5=8F=AF?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 176 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 164 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index cc981c6..7a09c3a 100644 --- a/index.html +++ b/index.html @@ -313,6 +313,19 @@ console.error("Get Toplist Songs failed", e); return []; } + }, + getPlaylist: async (id, source = 'netease') => { + try { + const res = await fetch(`${API_BASE}/api/?type=playlist&id=${id}&source=${source}`); + const data = await res.json(); + if (data.code === 200 && data.data && Array.isArray(data.data.list)) { + return data.data.list; + } + return []; + } catch (e) { + console.error("Get playlist failed", e); + return []; + } } }; @@ -418,7 +431,7 @@ ); - const SideDrawer = ({ isOpen, onClose, view, setView, quality, setQuality, onClearCache, syncToken, setSyncToken, onSyncNow }) => { + const SideDrawer = ({ isOpen, onClose, view, setView, quality, setQuality, onClearCache, syncToken, setSyncToken, onSyncNow, onImportNetease, syncMode }) => { const [isSyncing, setIsSyncing] = useState(false); const [syncMsg, setSyncMsg] = useState(''); @@ -437,6 +450,19 @@ } }; + const handleNeteaseImportClick = () => { + const url = prompt("请输入网易云歌单分享链接\n(例如: https://music.163.com/playlist?id=...)"); + if (url) { + const match = url.match(/[?&]id=(\d+)/); + if (match && match[1]) { + onImportNetease(match[1]); + onClose(); + } else { + alert("无法识别歌单ID,请确保链接包含 id=数字"); + } + } + }; + if (!isOpen) return null; return ( @@ -484,7 +510,9 @@
- +
-

使用相同的密钥在多端同步收藏列表

+

+ {syncMode === 'netease_playlist' + ? '当前为网易云歌单同步模式,每15分钟自动刷新' + : '使用相同的密钥在多端同步收藏列表'} +

{syncMsg && {syncMsg}}
+
+ +

导入后将开启自动同步,每15分钟获取新歌

+
+