From 598dd8bd34a7698c5c8aee44a4b42c94913fa043 Mon Sep 17 00:00:00 2001 From: ElyPrism Date: Fri, 26 Dec 2025 19:51:13 +0800 Subject: [PATCH] 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> --- .env.prod.example | 20 +-- .github/workflows/npm.yml | 30 +++- README.MD | 32 ++++- module/song_url_match.js | 18 +-- module/song_url_v1.js | 72 +++++----- package.json | 4 +- pnpm-lock.yaml | 278 ++++++++++++++++++++++++++++++++++++-- public/docs/home.md | 12 +- public/unblock_test.html | 38 +----- server.js | 13 +- vercel.json | 2 +- 11 files changed, 381 insertions(+), 138 deletions(-) diff --git a/.env.prod.example b/.env.prod.example index a1ed481..c4d52d7 100644 --- a/.env.prod.example +++ b/.env.prod.example @@ -10,29 +10,15 @@ PROXY_URL = "https://your-proxy-url.com/?proxy=" ### UnblockNeteaseMusic 设置项 -## 启用全局解灰, 无论是否调用参数都会使用解灰(推荐开启) -ENABLE_GENERAL_UNBLOCK = true +## 启用全局解灰, 无论是否调用参数都会使用解灰(不推荐开启) +ENABLE_GENERAL_UNBLOCK = false ## 歌曲启用无损音质 ENABLE_FLAC = true ## 启用无损音质时,是否选择音质最高的 SELECT_MAX_BR = false -## 音源设置 -UNBLOCK_SOURCE = pyncmd,qq,bodian,migu,kugou,kuwo ## 严格按照配置音源设置顺序进行匹配 FOLLOW_SOURCE_ORDER = true ## Cookie设置项; 推荐在Vercel等平台进行环境变量的设置或者设置github secret # 网易云 cookie # 格式:MUSIC_U=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -NETEASE_COOKIE = "" -# JOOX cookie -# 格式:JOOX_COOKIE="wmid=; session_key=" -JOOX_COOKIE = "" -# 咪咕 cookie -# 格式:MIGU_COOKIE="" -MIGU_COOKIE = "" -# qq cookie -# 格式:QQ_COOKIE="uin=; qm_keyst=" -QQ_COOKIE = "" -# Youtube 密钥 -# 格式:YOUTUBE_KEY="" -YOUTUBE_KEY = "" +# NETEASE_COOKIE = "" diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 1bb9232..c7c5801 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -5,6 +5,8 @@ on: push: branches: - main + paths: + - 'package.json' tags: - 'v*.*.*' workflow_dispatch: @@ -17,26 +19,52 @@ jobs: packages: write steps: - uses: actions/checkout@v5 + - name: Check if version has changed + id: version_check + run: | + # 获取当前提交中的版本号 + CURRENT_VERSION=$(node -p "require('./package.json').version") + echo "Current version: $CURRENT_VERSION" + + # 获取上一个提交中的版本号 + git fetch origin main --depth=1 + PREVIOUS_COMMIT=$(git rev-parse HEAD~1) + PREVIOUS_VERSION=$(git show $PREVIOUS_COMMIT:package.json | node -p "require('/dev/stdin').version" 2>/dev/null || echo "") + echo "Previous version: $PREVIOUS_VERSION" + + if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then + echo "Version has changed from $PREVIOUS_VERSION to $CURRENT_VERSION" + echo "version_changed=true" >> $GITHUB_OUTPUT + else + echo "Version has not changed" + echo "version_changed=false" >> $GITHUB_OUTPUT + fi # 发布到 NPM Registry - name: Setup Node.js for NPM + if: steps.version_check.outputs.version_changed == 'true' uses: actions/setup-node@v6 with: node-version: 20 registry-url: 'https://registry.npmjs.org/' - - run: npm install + - name: Install dependencies + if: steps.version_check.outputs.version_changed == 'true' + run: npm install - name: Publish to NPM + if: steps.version_check.outputs.version_changed == 'true' run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # 发布到 GitHub Packages - name: Setup Node.js for GitHub Packages + if: steps.version_check.outputs.version_changed == 'true' uses: actions/setup-node@v6 with: node-version: 20 registry-url: 'https://npm.pkg.github.com' - name: Publish to GitHub Packages + if: steps.version_check.outputs.version_changed == 'true' run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ github.token }} diff --git a/README.MD b/README.MD index 5cb9253..f55f778 100644 --- a/README.MD +++ b/README.MD @@ -4,7 +4,7 @@ ## 项目简介 -本项目为网易云音乐第三方 Node.js API,基于社区停更的原版 API 持续维护和升级,支持丰富的音乐相关接口,适合自建服务、二次开发和多平台部署(如果原版诈尸, 我会及时同步 or 归档)。 +本项目为网易云音乐第三方 Node.js API,基于停更的原版 API 持续维护,支持丰富的音乐相关接口,适合自建服务、二次开发和多平台部署(如果原版诈尸, 我会及时同步 or 归档)。 ## 快速开始 @@ -77,7 +77,7 @@ docker run -d \ 运行后访问 http://localhost:3000 即可使用 API。 -### 3. 环境变量 +## 3. 环境变量 | 变量名 | 默认值 | 说明 | | -------------------------- | ------------------------------------ | ------------------------------------------------------------------------------ | @@ -87,7 +87,6 @@ docker run -d \ | **ENABLE_GENERAL_UNBLOCK** | `true` | 是否启用全局解灰(推荐开启)。开启后所有歌曲都尝试自动解锁。 | | **ENABLE_FLAC** | `true` | 是否启用无损音质(FLAC)。 | | **SELECT_MAX_BR** | `false` | 启用无损音质时,是否选择最高码率音质。 | -| **UNBLOCK_SOURCE** | `pyncmd,qq,bodian,migu,kugou,kuwo` | 音源优先级列表(多个音源以逗号分隔)。 | | **FOLLOW_SOURCE_ORDER** | `true` | 是否严格按照音源列表顺序进行匹配。 | --- @@ -157,15 +156,27 @@ pnpm test - 用户信息、歌单、动态、播放记录 - 歌曲、专辑、歌手、MV、歌词、评论、排行榜 - 搜索、推荐、私人 FM、签到、云盘 -- 歌曲解锁(解灰)、多音源支持(qq/bodian/kuwo/kugou/migu/pyncmd) - > 注意: 如果解灰出现问题, 本项目只是集成[UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server)的接口, 请在对应的仓库开启议题 -- 详细接口请见[在线文档](https://neteasecloudmusicapienhanced.js.org/) +- 歌曲解锁(解灰) ## 贡献与社区 - 欢迎提交 PR、Issue 参与维护 -## SDK 生态 +### 致谢 + +原作者 [Binaryify/NeteaseCloudMusicApi](https://github.com/binaryify/NeteaseCloudMusicApi) 项目为本项目基础 (该项目在`npmjs`网站上仍持续维护, 但 github 仓库已不再更新) + +感谢大佬们为逆向eapi, weapi等加密算法所做的贡献 + +项目参考: + +[trazyn/ieaseMusic](https://github.com/trazyn/ieaseMusic) + +[listen1/listen1_chrome_extension](https://github.com/listen1/listen1_chrome_extension) + +[chaunsin/netease-cloud-music](https://github.com/chaunsin/netease-cloud-music) + +### SDK 生态 | 语言 | 作者 | 地址 | 类型 | | ------ | ------------------------------------------- | ---------------------------------------------------------------------------------------- | ------ | @@ -173,6 +184,13 @@ pnpm test | Java | [1015770492](https://github.com/1015770492) | https://github.com/1015770492/yumbo-music-utils | 第三方 | | Python | [盧瞳](https://github.com/2061360308) | [NeteaseCloudMusic_PythonSDK](https://github.com/2061360308/NeteaseCloudMusic_PythonSDK) | 第三方 | + +### 依赖此项目的优秀开源项目 + +- [imsyy/splayer](https://github.com/imsyy/splayer) + +- [qier2222/YesPlayMusic](https://github.com/qier222/YesPlayMusic) + ## License [MIT License](https://github.com/MoeFurina/NeteaseCloudMusicApiEnhanced/blob/main/LICENSE) diff --git a/module/song_url_match.js b/module/song_url_match.js index 791f6fd..d2adbb0 100644 --- a/module/song_url_match.js +++ b/module/song_url_match.js @@ -6,23 +6,23 @@ const logger = require('../util/logger.js') module.exports = async (query, request) => { try { - const match = require('@unblockneteasemusic/server') - const source = query.source - ? query.source.split(',') - : ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou'] - const server = query.server ? query.server.split(',') : query.server - const result = await match(query.id, !server ? source : server) + const { + matchID, + } = require('@neteasecloudmusicapienhanced/unblockmusic-utils') + const result = await matchID(query.id, query.source) const proxy = process.env.PROXY_URL logger.info('开始解灰', query.id, result) const useProxy = process.env.ENABLE_PROXY || 'false' - if (result.url.includes('kuwo')) { - result.proxyUrl = useProxy === 'true' ? proxy + result.url : result.url + if (result.data.url && result.data.url.includes('kuwo')) { + result.proxyUrl = + useProxy === 'true' ? proxy + result.data.url : result.data.url } return { status: 200, body: { code: 200, - data: result, + data: result.data.url, + proxyUrl: result.proxyUrl || '', }, } } catch (e) { diff --git a/module/song_url_v1.js b/module/song_url_v1.js index b9b5f9a..03b3f49 100644 --- a/module/song_url_v1.js +++ b/module/song_url_v1.js @@ -1,13 +1,14 @@ // 歌曲链接 - v1 // 此版本不再采用 br 作为音质区分的标准 // 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), jymaster(超清母带) 进行音质判断 -// 当unblock为true时, 会尝试使用unblockneteasemusic进行解锁, 同时音质设置不会生效, 但仍然为必须传入参数 +// 当unblock为true时, 会尝试使用unblockmusic-utils进行解锁, 同时音质设置不会生效, 但仍然为必须传入参数 const logger = require('../util/logger.js') const createOption = require('../util/option.js') module.exports = async (query, request) => { - const match = require('@unblockneteasemusic/server') - const source = ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou'] + const { + matchID, + } = require('@neteasecloudmusicapienhanced/unblockmusic-utils') require('dotenv').config() const data = { ids: '[' + query.id + ']', @@ -16,48 +17,37 @@ module.exports = async (query, request) => { } if (query.unblock === 'true') { try { - const result = await match(query.id, source) + const result = await matchID(query.id, query.source) logger.info('Starting unblock(uses modules unblock):', query.id, result) - // avoid optional chaining for compatibility - let url - if (Array.isArray(result)) { - url = result[0] && result[0].url ? result[0].url : result[0] - } else { - url = result && result.url ? result.url : result - } - // decide proxyUrl after we resolved the actual url value + const useProxy = process.env.ENABLE_PROXY || 'false' let proxyUrl = '' - if (url) { - if (url.includes('kuwo')) { - const useProxy = process.env.ENABLE_PROXY || 'false' - if (useProxy === 'true' && process.env.PROXY_URL) { - proxyUrl = process.env.PROXY_URL + url - } else { - proxyUrl = url - } - } - return { - status: 200, - body: { - code: 200, - msg: 'Warning: you can only adjust unblock source in dotenv config, use /song/url/match instead.', - data: [ - { - id: Number(query.id), - url, - type: 'flac', - level: query.level, - freeTrialInfo: 'null', - fee: 0, - proxyUrl: proxyUrl || '', - }, - ], - }, - cookie: [], - } + if (result.data.url && result.data.url.includes('kuwo')) { + proxyUrl = + useProxy === 'true' && process.env.PROXY_URL + ? process.env.PROXY_URL + result.data.url + : result.data.url + } + return { + status: 200, + body: { + code: 200, + msg: 'Warning: Customizing unblock sources is not supported on this endpoint. Please use `/song/url/match` instead.', + data: [ + { + id: Number(query.id), + url: result.data.url, + type: 'flac', + level: query.level, + freeTrialInfo: 'null', + fee: 0, + proxyUrl: proxyUrl || '', + }, + ], + }, + cookie: [], } } catch (e) { - console.error('Error in unblockneteasemusic:', e) + console.error('Error in unblocking music:', e) } } if (data.level == 'sky') { diff --git a/package.json b/package.json index 4961372..26b5b12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neteasecloudmusicapienhanced/api", - "version": "4.29.19", + "version": "4.29.20", "description": "A revival project for NeteaseCloudMusicApi Node.js Services (Half Refactor & Enhanced)|| 网易云音乐 API 备份 + 增强 || 本项目自原版v4.28.0版本后开始自行维护", "scripts": { "dev": "nodemon app.js", @@ -66,7 +66,7 @@ "data" ], "dependencies": { - "@unblockneteasemusic/server": "^0.28.0", + "@neteasecloudmusicapienhanced/unblockmusic-utils": "^0.1.3", "axios": "^1.13.2", "crypto-js": "^4.2.0", "dotenv": "^17.2.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6bcbb02..604598d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,9 @@ importers: .: dependencies: - '@unblockneteasemusic/server': - specifier: ^0.28.0 - version: 0.28.0 + '@neteasecloudmusicapienhanced/unblockmusic-utils': + specifier: ^0.1.3 + version: 0.1.3 axios: specifier: ^1.13.2 version: 1.13.2 @@ -225,6 +225,10 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@neteasecloudmusicapienhanced/unblockmusic-utils@0.1.3': + resolution: {integrity: sha512-X6DtL26AtRw4SsAG5iW+0ZbcvCrdhXLlaCSL38UWp1HW+F5+QXocBtzE6wkcZN/ZXAiKpMow2+Y1Igjx/foN/A==} + hasBin: true + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -394,6 +398,10 @@ packages: engines: {node: '>= 12'} hasBin: true + accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + accepts@2.0.0: resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} engines: {node: '>= 0.6'} @@ -476,6 +484,9 @@ packages: array-find@1.0.0: resolution: {integrity: sha512-kO/vVCacW9mnpn3WPWbTVlEnOabK2L7LWi2HViURtCM46y1zb6I8UMjx4LgbiqadTgHnLInUronwn3ampNTJtQ==} + array-flatten@1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -527,6 +538,10 @@ packages: bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + body-parser@1.20.4: + resolution: {integrity: sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + body-parser@2.2.1: resolution: {integrity: sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==} engines: {node: '>=18'} @@ -661,6 +676,10 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + content-disposition@1.0.1: resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==} engines: {node: '>=18'} @@ -672,6 +691,9 @@ packages: convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + cookie-signature@1.0.7: + resolution: {integrity: sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==} + cookie-signature@1.2.2: resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} engines: {node: '>=6.6.0'} @@ -720,6 +742,14 @@ packages: dateformat@4.6.3: resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -772,6 +802,10 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} + destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} @@ -1053,6 +1087,10 @@ packages: resolution: {integrity: sha512-wxUJn2vTHvj/kZCVmc5/bJO15C7aSMyHeuXYY3geKpeKibaAoQGcEv5+sM6nHS2T7VF+QHS4hTWPiY2mKofEdg==} engines: {node: '>=12.0.0'} + express@4.22.1: + resolution: {integrity: sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==} + engines: {node: '>= 0.10.0'} + express@5.2.1: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} @@ -1083,21 +1121,25 @@ packages: fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} - fastq@1.19.1: - resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + fastq@1.20.1: + resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} - file-type@21.1.1: - resolution: {integrity: sha512-ifJXo8zUqbQ/bLbl9sFoqHNTNWbnPY1COImFfM6CCy7z+E+jC1eY9YfOKkx0fckIg+VljAy2/87T61fp0+eEkg==} + file-type@21.2.0: + resolution: {integrity: sha512-vCYBgFOrJQLoTzDyAXAL/RFfKnXXpUYt4+tipVy26nJJhT7ftgGETf2tAQF59EEL61i3MrorV/PG6tf7LJK7eg==} engines: {node: '>=20'} fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + finalhandler@1.3.2: + resolution: {integrity: sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==} + engines: {node: '>= 0.8'} + finalhandler@2.1.1: resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} engines: {node: '>= 18.0.0'} @@ -1149,6 +1191,10 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} + fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + fresh@2.0.0: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} @@ -1305,11 +1351,18 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} + https@1.0.0: + resolution: {integrity: sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg==} + husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} hasBin: true + iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + iconv-lite@0.7.1: resolution: {integrity: sha512-2Tth85cXwGFHfvRgZWszZSvdo+0Xsqmw8k8ZwxScfcBneNUraK+dxRxRm24nszx80Y0TVio8kKLt5sLE7ZCLlw==} engines: {node: '>=0.10.0'} @@ -1594,10 +1647,17 @@ packages: md5@2.3.0: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + media-typer@1.1.0: resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} engines: {node: '>= 0.8'} + merge-descriptors@1.0.3: + resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} + merge-descriptors@2.0.0: resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} engines: {node: '>=18'} @@ -1609,6 +1669,10 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + methods@1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -1629,6 +1693,11 @@ packages: resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} engines: {node: '>=18'} + mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + mimic-function@5.0.1: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} @@ -1663,6 +1732,9 @@ packages: resolution: {integrity: sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==} engines: {node: '>=4'} + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -1686,6 +1758,10 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + negotiator@1.0.0: resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} engines: {node: '>= 0.6'} @@ -1830,6 +1906,9 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-to-regexp@0.1.12: + resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} + path-to-regexp@8.3.0: resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} @@ -1988,6 +2067,10 @@ packages: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} + raw-body@2.5.3: + resolution: {integrity: sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==} + engines: {node: '>= 0.8'} + raw-body@3.0.2: resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} engines: {node: '>= 0.10'} @@ -2088,6 +2171,10 @@ packages: engines: {node: '>=10'} hasBin: true + send@0.19.2: + resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==} + engines: {node: '>= 0.8.0'} + send@1.2.1: resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} engines: {node: '>= 18'} @@ -2095,6 +2182,10 @@ packages: serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + serve-static@1.16.3: + resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==} + engines: {node: '>= 0.8.0'} + serve-static@2.2.1: resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} engines: {node: '>= 18'} @@ -2357,6 +2448,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + type-is@2.0.1: resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} engines: {node: '>= 0.6'} @@ -2423,6 +2518,10 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -2658,6 +2757,16 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@neteasecloudmusicapienhanced/unblockmusic-utils@0.1.3': + dependencies: + '@unblockneteasemusic/server': 0.28.0 + axios: 1.13.2 + express: 4.22.1 + https: 1.0.0 + transitivePeerDependencies: + - debug + - supports-color + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -2668,7 +2777,7 @@ snapshots: '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.19.1 + fastq: 1.20.1 '@pkgjs/parseargs@0.11.0': optional: true @@ -2882,6 +2991,11 @@ snapshots: pino: 6.14.0 pino-pretty: 7.6.1 + accepts@1.3.8: + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + accepts@2.0.0: dependencies: mime-types: 3.0.2 @@ -2955,6 +3069,8 @@ snapshots: array-find@1.0.0: {} + array-flatten@1.1.1: {} + array-union@2.1.0: {} arraybuffer.prototype.slice@1.0.4: @@ -3005,6 +3121,23 @@ snapshots: inherits: 2.0.4 readable-stream: 3.6.2 + body-parser@1.20.4: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.14.0 + raw-body: 2.5.3 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + body-parser@2.2.1: dependencies: bytes: 3.1.2 @@ -3165,12 +3298,18 @@ snapshots: concat-map@0.0.1: {} + content-disposition@0.5.4: + dependencies: + safe-buffer: 5.2.1 + content-disposition@1.0.1: {} content-type@1.0.5: {} convert-source-map@1.9.0: {} + cookie-signature@1.0.7: {} + cookie-signature@1.2.2: {} cookie@0.7.2: {} @@ -3216,6 +3355,10 @@ snapshots: dateformat@4.6.3: {} + debug@2.6.9: + dependencies: + ms: 2.0.0 + debug@4.4.3: dependencies: ms: 2.1.3 @@ -3275,6 +3418,8 @@ snapshots: depd@2.0.0: {} + destroy@1.2.0: {} + detect-libc@2.1.2: {} diff-match-patch@1.0.5: {} @@ -3670,6 +3815,42 @@ snapshots: dependencies: busboy: 1.6.0 + express@4.22.1: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.4 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.7.2 + cookie-signature: 1.0.7 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.3.2 + fresh: 0.5.2 + http-errors: 2.0.1 + merge-descriptors: 1.0.3 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.12 + proxy-addr: 2.0.7 + qs: 6.14.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.19.2 + serve-static: 1.16.3 + setprototypeof: 1.2.0 + statuses: 2.0.2 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + express@5.2.1: dependencies: accepts: 2.0.0 @@ -3727,7 +3908,7 @@ snapshots: fast-safe-stringify@2.1.1: {} - fastq@1.19.1: + fastq@1.20.1: dependencies: reusify: 1.1.0 @@ -3735,7 +3916,7 @@ snapshots: dependencies: flat-cache: 4.0.1 - file-type@21.1.1: + file-type@21.2.0: dependencies: '@tokenizer/inflate': 0.4.1 strtok3: 10.3.4 @@ -3748,6 +3929,18 @@ snapshots: dependencies: to-regex-range: 5.0.1 + finalhandler@1.3.2: + dependencies: + debug: 2.6.9 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + finalhandler@2.1.1: dependencies: debug: 4.4.3 @@ -3801,6 +3994,8 @@ snapshots: forwarded@0.2.0: {} + fresh@0.5.2: {} + fresh@2.0.0: {} from2@2.3.0: @@ -3978,8 +4173,14 @@ snapshots: transitivePeerDependencies: - supports-color + https@1.0.0: {} + husky@9.1.7: {} + iconv-lite@0.4.24: + dependencies: + safer-buffer: 2.1.2 + iconv-lite@0.7.1: dependencies: safer-buffer: 2.1.2 @@ -4263,8 +4464,12 @@ snapshots: crypt: 0.0.2 is-buffer: 1.1.6 + media-typer@0.3.0: {} + media-typer@1.1.0: {} + merge-descriptors@1.0.3: {} + merge-descriptors@2.0.0: {} merge-estraverse-visitors@1.0.0: @@ -4273,6 +4478,8 @@ snapshots: merge2@1.4.1: {} + methods@1.1.2: {} + micromatch@4.0.8: dependencies: braces: 3.0.3 @@ -4290,6 +4497,8 @@ snapshots: dependencies: mime-db: 1.54.0 + mime@1.6.0: {} + mimic-function@5.0.1: {} mimic-response@3.1.0: {} @@ -4334,6 +4543,8 @@ snapshots: mri@1.1.4: {} + ms@2.0.0: {} + ms@2.1.3: {} multi-stage-sourcemap@0.2.1: @@ -4351,7 +4562,7 @@ snapshots: '@tokenizer/token': 0.3.0 content-type: 1.0.5 debug: 4.4.3 - file-type: 21.1.1 + file-type: 21.2.0 media-typer: 1.1.0 strtok3: 10.3.4 token-types: 6.1.1 @@ -4365,6 +4576,8 @@ snapshots: natural-compare@1.4.0: {} + negotiator@0.6.3: {} + negotiator@1.0.0: {} netmask@2.0.2: {} @@ -4516,6 +4729,8 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-to-regexp@0.1.12: {} + path-to-regexp@8.3.0: {} path-type@4.0.0: {} @@ -4730,6 +4945,13 @@ snapshots: range-parser@1.2.1: {} + raw-body@2.5.3: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + raw-body@3.0.2: dependencies: bytes: 3.1.2 @@ -4854,6 +5076,24 @@ snapshots: semver@7.7.3: {} + send@0.19.2: + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.1 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + send@1.2.1: dependencies: debug: 4.4.3 @@ -4874,6 +5114,15 @@ snapshots: dependencies: randombytes: 2.1.0 + serve-static@1.16.3: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.19.2 + transitivePeerDependencies: + - supports-color + serve-static@2.2.1: dependencies: encodeurl: 2.0.0 @@ -5173,6 +5422,11 @@ snapshots: dependencies: prelude-ls: 1.2.1 + type-is@1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + type-is@2.0.1: dependencies: content-type: 1.0.5 @@ -5258,6 +5512,8 @@ snapshots: util-deprecate@1.0.2: {} + utils-merge@1.0.1: {} + vary@1.1.2: {} webidl-conversions@3.0.1: {} diff --git a/public/docs/home.md b/public/docs/home.md index 2ac17e9..1bb55a3 100644 --- a/public/docs/home.md +++ b/public/docs/home.md @@ -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` ### 搜索 diff --git a/public/unblock_test.html b/public/unblock_test.html index 183c1c2..9d35020 100644 --- a/public/unblock_test.html +++ b/public/unblock_test.html @@ -58,33 +58,8 @@
-

选择音源:

-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
+ +
@@ -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 = '正在请求...'; diff --git a/server.js b/server.js index b96c1b1..3191db6 100644 --- a/server.js +++ b/server.js @@ -254,13 +254,12 @@ async function consturctServer(moduleDefs) { !song.url || [1, 4].includes(song.fee) ) { - const match = require('@unblockneteasemusic/server') - const source = process.env.UNBLOCK_SOURCE - ? process.env.UNBLOCK_SOURCE.split(',') - : ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou'] - logger.info('Starting unblock(uses general unblock):', source) - const { url } = await match(req.query.id, source) - song.url = url + const { + matchID, + } = require('@neteasecloudmusicapienhanced/unblockmusic-utils') + logger.info('Starting unblock(uses general unblock):', req.query.id) + const result = await matchID(req.query.id) + song.url = result.data.url song.freeTrialInfo = 'null' logger.info('Unblock success! url:', song.url) } diff --git a/vercel.json b/vercel.json index 1aedba9..2c3e9e2 100644 --- a/vercel.json +++ b/vercel.json @@ -20,6 +20,6 @@ "env": { "NODE_ENV": "production", "ENABLE_FLAC": "true", - "ENABLE_GENERAL_UNBLOCK": "true" + "ENABLE_GENERAL_UNBLOCK": "false" } }