mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
refactor(unblock): Refactor song URL matching to use new utils package (#73)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot]
parent
30bd839809
commit
598dd8bd34
+4
-8
@@ -1244,7 +1244,7 @@ tags: 歌单标签
|
||||
**必选参数 :** `id` : 音乐 id
|
||||
`level`: 播放音质等级, 分为 `standard` => `标准`,`higher` => `较高`, `exhigh`=>`极高`,
|
||||
`lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带`
|
||||
`unblock`: 是否使用`UnblockNeteaseMusic`, 分为`true`和`false`
|
||||
`unblock`: 是否使用使用歌曲解锁, 分为`true`和`false`
|
||||
|
||||
**接口地址 :** `/song/url/v1`
|
||||
|
||||
@@ -1252,8 +1252,6 @@ tags: 歌单标签
|
||||
|
||||
说明:`杜比全景声`音质需要设备支持,不同的设备可能会返回不同码率的 url。cookie 需要传入`os=pc`保证返回正常码率的 url。
|
||||
|
||||
注意: 如果解灰出现问题, 本项目只是集成[UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server)的接口, 请在对应的仓库开启议题
|
||||
|
||||
### 音乐是否可用
|
||||
|
||||
说明: 调用此接口,传入歌曲 id, 可获取音乐是否可用,返回 `{ success: true, message: 'ok' }` 或者 `{ success: false, message: '亲爱的,暂无版权' }`
|
||||
@@ -1268,17 +1266,15 @@ tags: 歌单标签
|
||||
|
||||
### 直接获取灰色歌曲链接
|
||||
|
||||
说明 : 技术来自于 [UnblockNeteaseMusic](https://github.com/unblockneteasemusic/server) 的支持, 聚合多个音源匹配(有几率匹配不成功)
|
||||
说明 : 技术部分来自于 [UnblockNeteaseMusic](https://github.com/unblockneteasemusic/server) 的支持
|
||||
|
||||
**必选参数 :** `id` : 音乐 id
|
||||
|
||||
**可选参数 :** `source`: 选择要解灰的音源, 目前支持`pyncmd`, `bodian`, `kuwo`, `kugou`, `qq`, `migu`, 选择多个音源中间用`,`分隔
|
||||
**可选参数 :** `source`: 选择要解灰的音源, 不支持多音源
|
||||
|
||||
**接口地址 :** `/song/url/match`
|
||||
|
||||
**调用例子 :** `/song/url/match?id=1969519579` `/song/url/match?id=1969519579&source=pyncmd,bodian`
|
||||
|
||||
注意: 如果解灰出现问题, 本项目只是集成[UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server)的接口, 请在对应的仓库开启议题
|
||||
**调用例子 :** `/song/url/match?id=1969519579` `/song/url/match?id=1969519579`
|
||||
|
||||
### 搜索
|
||||
|
||||
|
||||
@@ -58,33 +58,8 @@
|
||||
<input type="number" id="songId" placeholder="请输入音乐ID" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<p>选择音源:</p>
|
||||
<div class="source-options">
|
||||
<div class="source-option">
|
||||
<input type="checkbox" id="pyncmd" value="pyncmd">
|
||||
<label for="pyncmd">pyncmd</label>
|
||||
</div>
|
||||
<div class="source-option">
|
||||
<input type="checkbox" id="kuwo" value="kuwo">
|
||||
<label for="kuwo">kuwo</label>
|
||||
</div>
|
||||
<div class="source-option">
|
||||
<input type="checkbox" id="bodian" value="bodian">
|
||||
<label for="bodian">bodian</label>
|
||||
</div>
|
||||
<div class="source-option">
|
||||
<input type="checkbox" id="qq" value="qq">
|
||||
<label for="qq">qq</label>
|
||||
</div>
|
||||
<div class="source-option">
|
||||
<input type="checkbox" id="kugou" value="kugou">
|
||||
<label for="kugou">kugou</label>
|
||||
</div>
|
||||
<div class="source-option">
|
||||
<input type="checkbox" id="migu" value="migu">
|
||||
<label for="migu">migu</label>
|
||||
</div>
|
||||
</div>
|
||||
<label for="sources">音源列表:</label>
|
||||
<input type="text" id="sources" placeholder="请输入音源(非必填)">
|
||||
</div>
|
||||
<button onclick="testSong()">开始测试</button>
|
||||
<div id="result"></div>
|
||||
@@ -98,14 +73,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const sources = ['pyncmd', 'kuwo', 'bodian', 'qq', 'kugou', 'migu']
|
||||
.filter(source => document.getElementById(source).checked)
|
||||
.join(',');
|
||||
const sources = document.getElementById('sources').value;
|
||||
|
||||
|
||||
if (!sources) {
|
||||
alert('请至少选择一个音源');
|
||||
return;
|
||||
}
|
||||
|
||||
const resultDiv = document.getElementById('result');
|
||||
resultDiv.textContent = '正在请求...';
|
||||
|
||||
Reference in New Issue
Block a user