mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-08-12 17:10:37 +00:00
83 lines
2.8 KiB
HTML
83 lines
2.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="icon" href="docs/netease.png">
|
|
<link rel="stylesheet" href="/static/shell.css">
|
|
<title>音乐解灰测试</title>
|
|
<style>
|
|
body { padding: 1.25rem; }
|
|
.hint {
|
|
font-size: 0.75rem;
|
|
color: var(--muted-foreground);
|
|
margin-top: 0.25rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header class="shell-topbar">
|
|
<a class="brand" href="/"><img src="docs/netease.png" alt="logo">解灰测试</a>
|
|
<nav>
|
|
<a class="shell-btn shell-btn--ghost shell-btn--sm" href="/">返回首页</a>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="shell-main">
|
|
<div class="shell-container shell-narrow" style="max-width:50rem">
|
|
<header class="shell-header">
|
|
<h1>音乐解灰测试</h1>
|
|
<p class="sub">测试多音源替换匹配,解除灰色歌曲限制</p>
|
|
</header>
|
|
|
|
<section class="shell-card">
|
|
<div class="form-group">
|
|
<label for="songId">音乐 ID</label>
|
|
<input type="number" id="songId" placeholder="请输入音乐ID" />
|
|
<div class="hint">例如: 1372188635</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="sources">音源列表(可选)</label>
|
|
<input type="text" id="sources" placeholder="请输入音源" />
|
|
<div class="hint">例如: kuwo, kugou, migu</div>
|
|
</div>
|
|
|
|
<button id="testBtn" class="shell-btn shell-btn--default" onclick="testSong()">开始测试</button>
|
|
|
|
<pre id="result" style="margin-top:1.5rem;min-height:6.25rem"></pre>
|
|
</section>
|
|
</div>
|
|
</main>
|
|
|
|
<script>
|
|
async function testSong() {
|
|
const songId = document.getElementById('songId').value;
|
|
const sources = document.getElementById('sources').value;
|
|
const testBtn = document.getElementById('testBtn');
|
|
const resultDiv = document.getElementById('result');
|
|
|
|
if (!songId) {
|
|
alert('请输入音乐ID');
|
|
return;
|
|
}
|
|
|
|
testBtn.disabled = true;
|
|
testBtn.textContent = '测试中...';
|
|
resultDiv.textContent = '正在请求...';
|
|
|
|
try {
|
|
const response = await fetch(`/song/url/match?id=${songId}&source=${sources}`);
|
|
const data = await response.json();
|
|
resultDiv.textContent = JSON.stringify(data, null, 2);
|
|
} catch (error) {
|
|
resultDiv.textContent = `请求失败: ${error.message}`;
|
|
} finally {
|
|
testBtn.disabled = false;
|
|
testBtn.textContent = '开始测试';
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|