@neteasecloudmusicapienhanced/api 4.29.19 → 4.29.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.MD CHANGED
@@ -4,13 +4,22 @@
4
4
 
5
5
  ## 项目简介
6
6
 
7
- 本项目为网易云音乐第三方 Node.js API,基于社区停更的原版 API 持续维护和升级,支持丰富的音乐相关接口,适合自建服务、二次开发和多平台部署(如果原版诈尸, 我会及时同步 or 归档)。
7
+ 本项目为网易云音乐第三方 Node.js API,基于停更的原版 API 持续维护,支持丰富的音乐相关接口,适合自建服务、二次开发和多平台部署(如果原版诈尸, 我会及时同步 or 归档)。
8
+
9
+ > [!IMPORTANT]
10
+ >
11
+ > ## 注意
12
+ >
13
+ > - 本项目是一个高度去中心化的第三方 API,其维护都由社区志愿者使用`Pull Request`完成。
14
+ > - 使用本项目时请务必遵守相关法律法规,遵守`MIT`协议, 尊重网易云音乐的服务条款。
15
+ > - 原作者项目 [Binaryify/NeteaseCloudMusicApi](https://github.com/binaryify/NeteaseCloudMusicApi) 并非完全停止维护, 你可以在 [NeteaseCloudMusicApi 的 NPMJS 页面](https://www.npmjs.com/package/NeteaseCloudMusicApi) 查看最新版本信息。
16
+ > - 感谢尊重和理解!
8
17
 
9
18
  ## 快速开始
10
19
 
11
20
  ### 环境要求
12
21
 
13
- - Node.js 14 及以上
22
+ - Node.js 18 及以上
14
23
  - 推荐使用 pnpm 进行依赖管理
15
24
 
16
25
  ### 安装
@@ -51,33 +60,45 @@ set PORT=4000 && node app.js # Windows
51
60
 
52
61
  本项目支持通过 Docker 一键部署,无需手动安装 Node.js 或依赖。
53
62
 
54
- ### 1. 拉取镜像
63
+ > 注意: 在 docker 中运行的时候, 由于使用了 request 来发请求, 所以会检查几个 proxy 相关的环境变量(如下所列), 这些环境变量 会影响到 request 的代理, 详情请参考[request 的文档](https://github.com/request/request#proxies), 如果这些环境变量 指向的代理不可用, 那么就会造成错误, 所以在使用 docker 的时候一定要注意这些环境变量. 不过, 要是你在 query 中加上了 proxy 参数, 那么环境变量会被覆盖, 就会用你通过 proxy 参数提供的代理了.
55
64
 
56
- Docker Hub 拉取最新版本镜像:
65
+ request 相关的环境变量
57
66
 
58
- ```bash
67
+ 1. http_proxy
68
+ 2. https_proxy
69
+ 3. HTTP_PROXY
70
+ 4. HTTPS_PROXY
71
+ 5. no_proxy
72
+ 6. NO_PROXY
73
+
74
+ ```shell
59
75
  docker pull moefurina/ncm-api:latest
60
- ```
61
76
 
62
- 或指定版本(与 package.json 中版本号一致):
77
+ docker run -d -p 3000:3000 --name ncm-api moefurina/ncm-api:latest
63
78
 
64
- ```bash
65
- docker pull moefurina/ncm-api:4.29.0
66
79
 
67
- ```
80
+ // 或者
81
+ docker run -d -p 3000:3000 moefurina/ncm-api:latest
68
82
 
69
- ### 2. 运行容器
83
+ // 去掉或者设置相关的环境变量
70
84
 
71
- ```bash
72
- docker run -d \
73
- --name ncm-api \
74
- -p 3000:3000 \
75
- moefurina/ncm-api:latest
85
+ docker run -d -p 3000:3000 --name ncm-api -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= moefurina/ncm-api:latest
86
+
87
+ // 或者
88
+ docker run -d -p 3000:3000 -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= moefurina/ncm-api:latest
76
89
  ```
77
90
 
78
- 运行后访问 http://localhost:3000 即可使用 API。
91
+ > 以下是自行 build docker 镜像方式
92
+
93
+ ```shell
94
+ $ git clone https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced && cd api-enhanced
95
+
96
+ $ sudo docker build . -t ncm-api
97
+
98
+ $ sudo docker run -d -p 3000:3000 ncm-api
99
+ ```
79
100
 
80
- ### 3. 环境变量
101
+ ## 3. 环境变量
81
102
 
82
103
  | 变量名 | 默认值 | 说明 |
83
104
  | -------------------------- | ------------------------------------ | ------------------------------------------------------------------------------ |
@@ -87,7 +108,6 @@ docker run -d \
87
108
  | **ENABLE_GENERAL_UNBLOCK** | `true` | 是否启用全局解灰(推荐开启)。开启后所有歌曲都尝试自动解锁。 |
88
109
  | **ENABLE_FLAC** | `true` | 是否启用无损音质(FLAC)。 |
89
110
  | **SELECT_MAX_BR** | `false` | 启用无损音质时,是否选择最高码率音质。 |
90
- | **UNBLOCK_SOURCE** | `pyncmd,qq,bodian,migu,kugou,kuwo` | 音源优先级列表(多个音源以逗号分隔)。 |
91
111
  | **FOLLOW_SOURCE_ORDER** | `true` | 是否严格按照音源列表顺序进行匹配。 |
92
112
 
93
113
  ---
@@ -157,15 +177,27 @@ pnpm test
157
177
  - 用户信息、歌单、动态、播放记录
158
178
  - 歌曲、专辑、歌手、MV、歌词、评论、排行榜
159
179
  - 搜索、推荐、私人 FM、签到、云盘
160
- - 歌曲解锁(解灰)、多音源支持(qq/bodian/kuwo/kugou/migu/pyncmd)
161
- > 注意: 如果解灰出现问题, 本项目只是集成[UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server)的接口, 请在对应的仓库开启议题
162
- - 详细接口请见[在线文档](https://neteasecloudmusicapienhanced.js.org/)
180
+ - 歌曲解锁(解灰)
163
181
 
164
182
  ## 贡献与社区
165
183
 
166
184
  - 欢迎提交 PR、Issue 参与维护
167
185
 
168
- ## SDK 生态
186
+ ### 致谢
187
+
188
+ 原作者 [Binaryify/NeteaseCloudMusicApi](https://github.com/binaryify/NeteaseCloudMusicApi) 项目为本项目基础 (该项目在`npmjs`网站上仍持续维护, 但 github 仓库已不再更新)
189
+
190
+ 感谢大佬们为逆向eapi, weapi等加密算法所做的贡献
191
+
192
+ 项目参考:
193
+
194
+ [trazyn/ieaseMusic](https://github.com/trazyn/ieaseMusic)
195
+
196
+ [listen1/listen1_chrome_extension](https://github.com/listen1/listen1_chrome_extension)
197
+
198
+ [chaunsin/netease-cloud-music](https://github.com/chaunsin/netease-cloud-music)
199
+
200
+ ### SDK 生态
169
201
 
170
202
  | 语言 | 作者 | 地址 | 类型 |
171
203
  | ------ | ------------------------------------------- | ---------------------------------------------------------------------------------------- | ------ |
@@ -173,6 +205,13 @@ pnpm test
173
205
  | Java | [1015770492](https://github.com/1015770492) | https://github.com/1015770492/yumbo-music-utils | 第三方 |
174
206
  | Python | [盧瞳](https://github.com/2061360308) | [NeteaseCloudMusic_PythonSDK](https://github.com/2061360308/NeteaseCloudMusic_PythonSDK) | 第三方 |
175
207
 
208
+
209
+ ### 依赖此项目的优秀开源项目
210
+
211
+ - [imsyy/splayer](https://github.com/imsyy/splayer)
212
+
213
+ - [qier2222/YesPlayMusic](https://github.com/qier222/YesPlayMusic)
214
+
176
215
  ## License
177
216
 
178
217
  [MIT License](https://github.com/MoeFurina/NeteaseCloudMusicApiEnhanced/blob/main/LICENSE)
@@ -6,23 +6,23 @@ const logger = require('../util/logger.js')
6
6
 
7
7
  module.exports = async (query, request) => {
8
8
  try {
9
- const match = require('@unblockneteasemusic/server')
10
- const source = query.source
11
- ? query.source.split(',')
12
- : ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou']
13
- const server = query.server ? query.server.split(',') : query.server
14
- const result = await match(query.id, !server ? source : server)
9
+ const {
10
+ matchID,
11
+ } = require('@neteasecloudmusicapienhanced/unblockmusic-utils')
12
+ const result = await matchID(query.id, query.source)
15
13
  const proxy = process.env.PROXY_URL
16
14
  logger.info('开始解灰', query.id, result)
17
15
  const useProxy = process.env.ENABLE_PROXY || 'false'
18
- if (result.url.includes('kuwo')) {
19
- result.proxyUrl = useProxy === 'true' ? proxy + result.url : result.url
16
+ if (result.data.url && result.data.url.includes('kuwo')) {
17
+ result.proxyUrl =
18
+ useProxy === 'true' ? proxy + result.data.url : result.data.url
20
19
  }
21
20
  return {
22
21
  status: 200,
23
22
  body: {
24
23
  code: 200,
25
- data: result,
24
+ data: result.data.url,
25
+ proxyUrl: result.proxyUrl || '',
26
26
  },
27
27
  }
28
28
  } catch (e) {
@@ -1,13 +1,14 @@
1
1
  // 歌曲链接 - v1
2
2
  // 此版本不再采用 br 作为音质区分的标准
3
3
  // 而是采用 standard, exhigh, lossless, hires, jyeffect(高清环绕声), sky(沉浸环绕声), jymaster(超清母带) 进行音质判断
4
- // 当unblock为true时, 会尝试使用unblockneteasemusic进行解锁, 同时音质设置不会生效, 但仍然为必须传入参数
4
+ // 当unblock为true时, 会尝试使用unblockmusic-utils进行解锁, 同时音质设置不会生效, 但仍然为必须传入参数
5
5
 
6
6
  const logger = require('../util/logger.js')
7
7
  const createOption = require('../util/option.js')
8
8
  module.exports = async (query, request) => {
9
- const match = require('@unblockneteasemusic/server')
10
- const source = ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou']
9
+ const {
10
+ matchID,
11
+ } = require('@neteasecloudmusicapienhanced/unblockmusic-utils')
11
12
  require('dotenv').config()
12
13
  const data = {
13
14
  ids: '[' + query.id + ']',
@@ -16,48 +17,37 @@ module.exports = async (query, request) => {
16
17
  }
17
18
  if (query.unblock === 'true') {
18
19
  try {
19
- const result = await match(query.id, source)
20
+ const result = await matchID(query.id, query.source)
20
21
  logger.info('Starting unblock(uses modules unblock):', query.id, result)
21
- // avoid optional chaining for compatibility
22
- let url
23
- if (Array.isArray(result)) {
24
- url = result[0] && result[0].url ? result[0].url : result[0]
25
- } else {
26
- url = result && result.url ? result.url : result
27
- }
28
- // decide proxyUrl after we resolved the actual url value
22
+ const useProxy = process.env.ENABLE_PROXY || 'false'
29
23
  let proxyUrl = ''
30
- if (url) {
31
- if (url.includes('kuwo')) {
32
- const useProxy = process.env.ENABLE_PROXY || 'false'
33
- if (useProxy === 'true' && process.env.PROXY_URL) {
34
- proxyUrl = process.env.PROXY_URL + url
35
- } else {
36
- proxyUrl = url
37
- }
38
- }
39
- return {
40
- status: 200,
41
- body: {
42
- code: 200,
43
- msg: 'Warning: you can only adjust unblock source in dotenv config, use /song/url/match instead.',
44
- data: [
45
- {
46
- id: Number(query.id),
47
- url,
48
- type: 'flac',
49
- level: query.level,
50
- freeTrialInfo: 'null',
51
- fee: 0,
52
- proxyUrl: proxyUrl || '',
53
- },
54
- ],
55
- },
56
- cookie: [],
57
- }
24
+ if (result.data.url && result.data.url.includes('kuwo')) {
25
+ proxyUrl =
26
+ useProxy === 'true' && process.env.PROXY_URL
27
+ ? process.env.PROXY_URL + result.data.url
28
+ : result.data.url
29
+ }
30
+ return {
31
+ status: 200,
32
+ body: {
33
+ code: 200,
34
+ msg: 'Warning: Customizing unblock sources is not supported on this endpoint. Please use `/song/url/match` instead.',
35
+ data: [
36
+ {
37
+ id: Number(query.id),
38
+ url: result.data.url,
39
+ type: 'flac',
40
+ level: query.level,
41
+ freeTrialInfo: 'null',
42
+ fee: 0,
43
+ proxyUrl: proxyUrl || '',
44
+ },
45
+ ],
46
+ },
47
+ cookie: [],
58
48
  }
59
49
  } catch (e) {
60
- console.error('Error in unblockneteasemusic:', e)
50
+ console.error('Error in unblocking music:', e)
61
51
  }
62
52
  }
63
53
  if (data.level == 'sky') {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neteasecloudmusicapienhanced/api",
3
- "version": "4.29.19",
4
- "description": "A revival project for NeteaseCloudMusicApi Node.js Services (Half Refactor & Enhanced)|| 网易云音乐 API 备份 + 增强 || 本项目自原版v4.28.0版本后开始自行维护",
3
+ "version": "4.29.21",
4
+ "description": "全网最全的网易云音乐API接口 || A revival project for NeteaseCloudMusicApi Node.js Services (Half Refactor & Enhanced) || 网易云音乐 API 备份 + 增强 || 本项目自原版v4.28.0版本后开始自行维护",
5
5
  "scripts": {
6
6
  "dev": "nodemon app.js",
7
7
  "start": "node app.js",
@@ -66,14 +66,14 @@
66
66
  "data"
67
67
  ],
68
68
  "dependencies": {
69
- "@unblockneteasemusic/server": "^0.28.0",
70
- "axios": "^1.13.2",
69
+ "@neteasecloudmusicapienhanced/unblockmusic-utils": "^0.1.3",
70
+ "axios": "^1.13.4",
71
71
  "crypto-js": "^4.2.0",
72
72
  "dotenv": "^17.2.3",
73
73
  "express": "^5.2.1",
74
74
  "express-fileupload": "^1.5.2",
75
75
  "md5": "^2.3.0",
76
- "music-metadata": "^11.10.3",
76
+ "music-metadata": "^11.11.1",
77
77
  "node-forge": "^1.3.3",
78
78
  "pac-proxy-agent": "^7.2.0",
79
79
  "qrcode": "^1.5.4",
@@ -88,22 +88,22 @@
88
88
  "@types/express": "^5.0.6",
89
89
  "@types/express-fileupload": "^1.5.1",
90
90
  "@types/mocha": "^10.0.10",
91
- "@types/node": "24.10.0",
92
- "@typescript-eslint/eslint-plugin": "8.46.2",
93
- "@typescript-eslint/parser": "8.46.3",
91
+ "@types/node": "25.0.9",
92
+ "@typescript-eslint/eslint-plugin": "8.46.3",
93
+ "@typescript-eslint/parser": "8.53.0",
94
94
  "eslint": "9.39.0",
95
95
  "eslint-config-prettier": "10.1.8",
96
96
  "eslint-plugin-html": "8.1.3",
97
- "eslint-plugin-prettier": "5.5.4",
97
+ "eslint-plugin-prettier": "5.5.5",
98
98
  "globals": "^16.5.0",
99
99
  "husky": "9.1.7",
100
100
  "intelli-espower-loader": "1.1.0",
101
- "lint-staged": "16.2.6",
101
+ "lint-staged": "16.2.7",
102
102
  "mocha": "11.7.5",
103
103
  "nodemon": "^3.1.11",
104
104
  "pkg": "^5.8.1",
105
105
  "power-assert": "1.6.1",
106
- "prettier": "3.6.2",
106
+ "prettier": "3.7.4",
107
107
  "typescript": "5.9.3"
108
108
  }
109
109
  }
package/public/cloud.html CHANGED
@@ -20,7 +20,6 @@
20
20
  <script src="https://fastly.jsdelivr.net/npm/axios@0.26.1/dist/axios.min.js"></script>
21
21
  <script src="https://fastly.jsdelivr.net/npm/vue"></script>
22
22
  <script>
23
- const logger = require('../util/logger.js')
24
23
  const app = Vue.createApp({
25
24
  data() {
26
25
  return {
@@ -32,14 +31,14 @@
32
31
  },
33
32
  methods: {
34
33
  getData() {
35
- logger.info('getdata')
34
+ console.info('getdata')
36
35
  const _this = this
37
36
  axios({
38
37
  url: `/user/cloud?time=${Date.now()}&cookie=${localStorage.getItem(
39
38
  'cookie',
40
39
  )}`,
41
40
  }).then((res) => {
42
- logger.info(res.data)
41
+ console.info(res.data)
43
42
  _this.songs = res.data.data
44
43
  })
45
44
  },
@@ -52,7 +51,7 @@
52
51
  document
53
52
  .querySelector('input[type="file"]')
54
53
  .addEventListener('change', function (e) {
55
- logger.info(this.files)
54
+ console.info(this.files)
56
55
  let currentIndx = 0
57
56
  fileLength = this.files.length
58
57
  for (const item of this.files) {
@@ -77,15 +76,15 @@
77
76
  data: formData,
78
77
  })
79
78
  .then((res) => {
80
- logger.info(`${file.name} 上传成功`)
79
+ console.info(`${file.name} 上传成功`)
81
80
  if (currentIndx >= fileLength) {
82
- logger.info('上传完毕')
81
+ console.info('上传完毕')
83
82
  }
84
83
  app.getData()
85
84
  })
86
85
  .catch(async (err) => {
87
- logger.info(err)
88
- logger.info(fileUpdateTime)
86
+ console.info(err)
87
+ console.info(fileUpdateTime)
89
88
  fileUpdateTime[file.name]
90
89
  ? (fileUpdateTime[file.name] += 1)
91
90
  : (fileUpdateTime[file.name] = 1)
@@ -1244,7 +1244,7 @@ tags: 歌单标签
1244
1244
  **必选参数 :** `id` : 音乐 id
1245
1245
  `level`: 播放音质等级, 分为 `standard` => `标准`,`higher` => `较高`, `exhigh`=>`极高`,
1246
1246
  `lossless`=>`无损`, `hires`=>`Hi-Res`, `jyeffect` => `高清环绕声`, `sky` => `沉浸环绕声`, `dolby` => `杜比全景声`, `jymaster` => `超清母带`
1247
- `unblock`: 是否使用`UnblockNeteaseMusic`, 分为`true`和`false`
1247
+ `unblock`: 是否使用使用歌曲解锁, 分为`true`和`false`
1248
1248
 
1249
1249
  **接口地址 :** `/song/url/v1`
1250
1250
 
@@ -1252,8 +1252,6 @@ tags: 歌单标签
1252
1252
 
1253
1253
  说明:`杜比全景声`音质需要设备支持,不同的设备可能会返回不同码率的 url。cookie 需要传入`os=pc`保证返回正常码率的 url。
1254
1254
 
1255
- 注意: 如果解灰出现问题, 本项目只是集成[UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server)的接口, 请在对应的仓库开启议题
1256
-
1257
1255
  ### 音乐是否可用
1258
1256
 
1259
1257
  说明: 调用此接口,传入歌曲 id, 可获取音乐是否可用,返回 `{ success: true, message: 'ok' }` 或者 `{ success: false, message: '亲爱的,暂无版权' }`
@@ -1268,17 +1266,15 @@ tags: 歌单标签
1268
1266
 
1269
1267
  ### 直接获取灰色歌曲链接
1270
1268
 
1271
- 说明 : 技术来自于 [UnblockNeteaseMusic](https://github.com/unblockneteasemusic/server) 的支持, 聚合多个音源匹配(有几率匹配不成功)
1269
+ 说明 : 技术部分来自于 [UnblockNeteaseMusic](https://github.com/unblockneteasemusic/server) 的支持
1272
1270
 
1273
1271
  **必选参数 :** `id` : 音乐 id
1274
1272
 
1275
- **可选参数 :** `source`: 选择要解灰的音源, 目前支持`pyncmd`, `bodian`, `kuwo`, `kugou`, `qq`, `migu`, 选择多个音源中间用`,`分隔
1273
+ **可选参数 :** `source`: 选择要解灰的音源, 不支持多音源
1276
1274
 
1277
1275
  **接口地址 :** `/song/url/match`
1278
1276
 
1279
- **调用例子 :** `/song/url/match?id=1969519579` `/song/url/match?id=1969519579&source=pyncmd,bodian`
1280
-
1281
- 注意: 如果解灰出现问题, 本项目只是集成[UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server)的接口, 请在对应的仓库开启议题
1277
+ **调用例子 :** `/song/url/match?id=1969519579` `/song/url/match?id=1969519579`
1282
1278
 
1283
1279
  ### 搜索
1284
1280
 
@@ -8,6 +8,19 @@
8
8
  <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
9
9
  </head>
10
10
 
11
+ <style>
12
+ .decode-result {
13
+ white-space: pre-wrap;
14
+ word-break: break-all;
15
+ background-color: #f0f0f0;
16
+ padding: 10px;
17
+ border-radius: 5px;
18
+ margin-top: 10px;
19
+ height: 300px;
20
+ overflow: auto;
21
+ }
22
+ </style>
23
+
11
24
  <body>
12
25
  <div id="app" class="p-5 flex flex-col">
13
26
  <h1 class="text-2xl font-bold mb-5">eapi 参数和返回内容解析</h1>
@@ -23,7 +36,7 @@
23
36
  </div>
24
37
  <div>
25
38
  <p>解密结果:
26
- <pre>{{ JSON.stringify(JSON.parse(result), null, 2) }}</pre>
39
+ <pre class="decode-result">{{ JSON.stringify(JSON.parse(result), null, 2) }}</pre>
27
40
  </p>
28
41
  </div>
29
42
 
@@ -39,7 +52,6 @@
39
52
  <script src="https://fastly.jsdelivr.net/npm/vue@3"></script>
40
53
 
41
54
  <script>
42
- const logger = require('../util/logger.js')
43
55
  const app = Vue.createApp({
44
56
  data() {
45
57
  return {
@@ -62,7 +74,7 @@
62
74
  }
63
75
  })
64
76
  this.result = JSON.stringify(res.data.data)
65
- logger.info(res.data);
77
+ console.log(res.data);
66
78
  } catch (error) {
67
79
  console.error(error)
68
80
  alert(error?.response?.data?.message || '解密失败,数据格式错误')
@@ -74,4 +86,4 @@
74
86
  </script>
75
87
  </body>
76
88
 
77
- </html>
89
+ </html>
package/public/home.html CHANGED
@@ -12,7 +12,6 @@
12
12
  </div>
13
13
  <script src="https://fastly.jsdelivr.net/npm/axios@0.26.1/dist/axios.min.js"></script>
14
14
  <script>
15
- const logger = require('../util/logger.js')
16
15
  async function main() {
17
16
  const res = await axios({
18
17
  url: `/homepage/block/page`,
@@ -22,7 +21,7 @@
22
21
  method: 'post',
23
22
  })
24
23
  let cursor = ''
25
- logger.info(res.data.data)
24
+ console.info(res.data.data)
26
25
  if (res.data.data.hasMore) {
27
26
  cursor = res.data.data.cursor
28
27
  const res2 = await axios({
@@ -88,7 +88,6 @@
88
88
  </details>
89
89
  </body>
90
90
  <script>
91
- const logger = require('../util/logger.js')
92
91
  PetiteVue.createApp({
93
92
  message: '请点击获取登录状态',
94
93
  account: {
@@ -140,7 +139,7 @@
140
139
  cookie: localStorage.getItem('cookie'),
141
140
  },
142
141
  })
143
- logger.info(res)
142
+ console.info(res)
144
143
  if (res.data.code != 200) {
145
144
  this.message = '加入房间出现问题: ' + res.data.message
146
145
  } else {
@@ -153,7 +152,7 @@
153
152
  cookie: localStorage.getItem('cookie'),
154
153
  },
155
154
  })
156
- logger.info(res2)
155
+ console.info(res2)
157
156
  const res3 = await axios({
158
157
  url: 'listentogether/sync/playlist/get',
159
158
  method: 'post',
@@ -174,7 +173,7 @@
174
173
  cookie: localStorage.getItem('cookie'),
175
174
  },
176
175
  })
177
- logger.info(resa)
176
+ console.info(resa)
178
177
  this.playlistInfo.playlistTracks = resa.data.songs
179
178
  }
180
179
  },
@@ -186,7 +185,7 @@
186
185
  cookie: localStorage.getItem('cookie'),
187
186
  },
188
187
  })
189
- logger.info(res)
188
+ console.info(res)
190
189
  if (res.data.code != 200) {
191
190
  this.message = '创建房间出现问题: ' + res.data.message
192
191
  } else {
@@ -201,7 +200,7 @@
201
200
  cookie: localStorage.getItem('cookie'),
202
201
  },
203
202
  })
204
- logger.info(res2)
203
+ console.info(res2)
205
204
  }
206
205
  },
207
206
  refreshRoom: async function () {
@@ -211,7 +210,7 @@
211
210
  cookie: localStorage.getItem('cookie'),
212
211
  },
213
212
  })
214
- logger.info(res)
213
+ console.info(res)
215
214
  if (res.data.code != 200 || !res.data.data.inRoom) {
216
215
  this.message = '房间状态获取失败, 可能退出了房间'
217
216
  } else {
@@ -227,7 +226,7 @@
227
226
  cookie: localStorage.getItem('cookie'),
228
227
  },
229
228
  })
230
- logger.info(res)
229
+ console.info(res)
231
230
  if (res.data.code != 200 || !res.data.data.success) {
232
231
  this.message = '房间关闭失败'
233
232
  } else {
@@ -244,7 +243,7 @@
244
243
  cookie: localStorage.getItem('cookie'),
245
244
  },
246
245
  })
247
- logger.info(res)
246
+ console.info(res)
248
247
  this.playlistInfo.playlistName = res.data.playlist.name
249
248
  this.playlistInfo.playlistTrackIds = res.data.playlist.trackIds
250
249
  .map((track) => track.id)
@@ -257,7 +256,7 @@
257
256
  cookie: localStorage.getItem('cookie'),
258
257
  },
259
258
  })
260
- logger.info(resa)
259
+ console.info(resa)
261
260
  this.playlistInfo.playlistTracks = resa.data.songs
262
261
  if (this.roomInfo.roomId) {
263
262
  const resb = await axios({
@@ -274,7 +273,7 @@
274
273
  cookie: localStorage.getItem('cookie'),
275
274
  },
276
275
  })
277
- logger.info(resb)
276
+ console.info(resb)
278
277
  }
279
278
  },
280
279
  gotoTrack: async function (trackId) {
@@ -317,7 +316,7 @@
317
316
  cookie: localStorage.getItem('cookie'),
318
317
  },
319
318
  })
320
- logger.info(res)
319
+ console.info(res)
321
320
  },
322
321
  }).mount()
323
322
  </script>
@@ -24,7 +24,7 @@
24
24
  })
25
25
  const key = res.data.data.unikey
26
26
  const res2 = await axios({
27
- url: `/login/qr/create?key=${key}&qrimg=true&timestamp=${Date.now()}`,
27
+ url: `/login/qr/create?key=${key}&platform=web&qrimg=true&timestamp=${Date.now()}`,
28
28
  })
29
29
  document.querySelector('#qrImg').src = res2.data.data.qrimg
30
30
 
@@ -23,7 +23,7 @@
23
23
  })
24
24
  const key = res.data.data.unikey
25
25
  const res2 = await axios({
26
- url: `/login/qr/create?key=${key}&qrimg=true&timestamp=${Date.now()}&ua=pc`,
26
+ url: `/login/qr/create?key=${key}&platform=web&qrimg=true&timestamp=${Date.now()}&ua=pc`,
27
27
  })
28
28
  document.querySelector('#qrImg').src = res2.data.data.qrimg
29
29
 
@@ -58,33 +58,8 @@
58
58
  <input type="number" id="songId" placeholder="请输入音乐ID" required>
59
59
  </div>
60
60
  <div class="form-group">
61
- <p>选择音源:</p>
62
- <div class="source-options">
63
- <div class="source-option">
64
- <input type="checkbox" id="pyncmd" value="pyncmd">
65
- <label for="pyncmd">pyncmd</label>
66
- </div>
67
- <div class="source-option">
68
- <input type="checkbox" id="kuwo" value="kuwo">
69
- <label for="kuwo">kuwo</label>
70
- </div>
71
- <div class="source-option">
72
- <input type="checkbox" id="bodian" value="bodian">
73
- <label for="bodian">bodian</label>
74
- </div>
75
- <div class="source-option">
76
- <input type="checkbox" id="qq" value="qq">
77
- <label for="qq">qq</label>
78
- </div>
79
- <div class="source-option">
80
- <input type="checkbox" id="kugou" value="kugou">
81
- <label for="kugou">kugou</label>
82
- </div>
83
- <div class="source-option">
84
- <input type="checkbox" id="migu" value="migu">
85
- <label for="migu">migu</label>
86
- </div>
87
- </div>
61
+ <label for="sources">音源列表:</label>
62
+ <input type="text" id="sources" placeholder="请输入音源(非必填)">
88
63
  </div>
89
64
  <button onclick="testSong()">开始测试</button>
90
65
  <div id="result"></div>
@@ -98,14 +73,9 @@
98
73
  return;
99
74
  }
100
75
 
101
- const sources = ['pyncmd', 'kuwo', 'bodian', 'qq', 'kugou', 'migu']
102
- .filter(source => document.getElementById(source).checked)
103
- .join(',');
76
+ const sources = document.getElementById('sources').value;
77
+
104
78
 
105
- if (!sources) {
106
- alert('请至少选择一个音源');
107
- return;
108
- }
109
79
 
110
80
  const resultDiv = document.getElementById('result');
111
81
  resultDiv.textContent = '正在请求...';
@@ -35,7 +35,6 @@
35
35
  <script src="https://fastly.jsdelivr.net/npm/axios@0.26.1/dist/axios.min.js"></script>
36
36
  <script src="https://fastly.jsdelivr.net/npm/vue"></script>
37
37
  <script>
38
- const logger = require('../util/logger.js')
39
38
  Vue.createApp({
40
39
  data() {
41
40
  return {
@@ -62,7 +61,7 @@
62
61
  },
63
62
  methods: {
64
63
  submit() {
65
- logger.info('submit')
64
+ console.info('submit')
66
65
  const file = document.querySelector('input[type=file]').files[0]
67
66
  this.upload(file)
68
67
  },
@@ -72,14 +71,14 @@
72
71
  url: `/voicelist/search?cookie=${localStorage.getItem('cookie')}`,
73
72
  })
74
73
 
75
- logger.info(res.data.data)
74
+ console.info(res.data.data)
76
75
  this.voicelist = res.data.data.list
77
76
  this.voicelist.map(async (i) => {
78
77
  const res2 = await axios({
79
78
  url: `/voicelist/list?voiceListId=${i.voiceListId}&limit=5`,
80
79
  })
81
80
  i.voiceListData = res2.data.data.list
82
- logger.info(res2)
81
+ console.info(res2)
83
82
  })
84
83
  },
85
84
  upload(file) {
@@ -104,11 +103,11 @@
104
103
  .then((res) => {
105
104
  alert(`${file.name} 上传成功`)
106
105
  if (currentIndx >= fileLength) {
107
- logger.info('上传完毕')
106
+ console.info('上传完毕')
108
107
  }
109
108
  })
110
109
  .catch(async (err) => {
111
- logger.info(err)
110
+ console.info(err)
112
111
  })
113
112
  },
114
113
  },
package/server.js CHANGED
@@ -254,13 +254,12 @@ async function consturctServer(moduleDefs) {
254
254
  !song.url ||
255
255
  [1, 4].includes(song.fee)
256
256
  ) {
257
- const match = require('@unblockneteasemusic/server')
258
- const source = process.env.UNBLOCK_SOURCE
259
- ? process.env.UNBLOCK_SOURCE.split(',')
260
- : ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou']
261
- logger.info('Starting unblock(uses general unblock):', source)
262
- const { url } = await match(req.query.id, source)
263
- song.url = url
257
+ const {
258
+ matchID,
259
+ } = require('@neteasecloudmusicapienhanced/unblockmusic-utils')
260
+ logger.info('Starting unblock(uses general unblock):', req.query.id)
261
+ const result = await matchID(req.query.id)
262
+ song.url = result.data.url
264
263
  song.freeTrialInfo = 'null'
265
264
  logger.info('Unblock success! url:', song.url)
266
265
  }
@@ -9,9 +9,9 @@ class AdvancedClientSignGenerator {
9
9
  try {
10
10
  const interfaces = os.networkInterfaces()
11
11
  for (let interfaceName in interfaces) {
12
- const networkInterface = interfaces[interfaceName]
13
- for (let i = 0; i < networkInterface.length; i++) {
14
- const alias = networkInterface[i]
12
+ const interfaceItem = interfaces[interfaceName]
13
+ for (let i = 0; i < interfaceItem.length; i++) {
14
+ const alias = interfaceItem[i]
15
15
  // 排除内部地址和无效地址
16
16
  if (
17
17
  alias.mac &&
@@ -166,4 +166,4 @@ class AdvancedClientSignGenerator {
166
166
  }
167
167
  }
168
168
 
169
- module.exports = AdvancedClientSignGenerator
169
+ module.exports = AdvancedClientSignGenerator