koishi-plugin-music-parser-all 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +41 -55
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-music-parser-all",
3
3
  "description": "Koishi 全平台音乐解析插件,支持网易云音乐/酷我音乐/QQ音乐/汽水音乐等平台",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
package/readme.md CHANGED
@@ -3,20 +3,20 @@
3
3
  ## 项目介绍 (Project Introduction)
4
4
 
5
5
  ### 中文
6
- 这是一个为 Koishi 机器人框架开发的**全平台音乐解析插件**,使用统一API接口,支持自动识别并解析网易云音乐、酷我音乐、QQ音乐、汽水音乐等主流音乐平台的歌曲链接,获取歌名、歌手、专辑、封面及高音质直链,并支持以语音消息发送音乐。内置独立接口优先、聚合接口备用的解析策略,同时支持自定义 API、平台扩展与字段映射。
6
+ 这是一个为 Koishi 机器人框架开发的**全平台音乐解析插件**,使用统一API接口,支持自动识别并解析网易云音乐、酷我音乐、QQ音乐、汽水音乐等主流平台的音乐链接,并支持通过自定义规则扩展更多平台。
7
7
 
8
8
  ### English
9
- This is a **multi-platform music parsing plugin** developed for the Koishi bot framework, using a unified API interface to automatically recognize and parse music links from major platforms such as NetEase Cloud Music, Kuwo Music, QQ Music, Qishui Music and more, obtaining track info, cover, and high-quality direct links, with optional voice message playback. It features dedicated API priority with aggregate API fallback, and supports custom APIs, platform extensions, and field mapping.
9
+ This is a **multi-platform music parsing plugin** developed for the Koishi bot framework. It uses a unified API interface to automatically recognize and parse music links from mainstream platforms such as Netease Cloud Music, Kuwo, QQ Music, Qishui, and supports extending more platforms through custom rules.
10
10
 
11
11
  ## 项目仓库 (Repository)
12
- - GitHub: https://github.com/Minecraft-1314/koishi-plugin-music-parser-all
13
- - Issues: https://github.com/Minecraft-1314/koishi-plugin-music-parser-all/issues
12
+ - GitHub: `https://github.com/Minecraft-1314/koishi-plugin-music-parser-all`
13
+ - Issues: `https://github.com/Minecraft-1314/koishi-plugin-music-parser-all/issues`
14
14
 
15
15
  ## 核心指令 (Core Commands)
16
16
 
17
- | 指令 | 说明 | 示例 |
18
- |------|------|------|
19
- | `music <url>` | 手动解析指定的音乐链接 | `music https://music.163.com/song?id=865632948` |
17
+ | 指令 (Command) | 说明 (Description) | 示例 (Example) |
18
+ |----------------|--------------------|----------------|
19
+ | `music <url>` | 手动解析指定的音乐链接 | `music https://music.163.com/song?id=123456` |
20
20
 
21
21
  ## 配置项说明 (Configuration)
22
22
 
@@ -27,7 +27,7 @@ This is a **multi-platform music parsing plugin** developed for the Koishi bot f
27
27
  | `botName` | string | 音乐解析机器人 | 合并转发中的昵称 |
28
28
  | `showWaitingTip` | boolean | true | 显示等待提示 |
29
29
  | `debug` | boolean | false | Debug 日志 |
30
- | `platformEnabled` | object | 全开 | 各平台开关(netease/kuwo/qqmusic/qishui) |
30
+ | `platformEnabled` | object | 全开 | 各平台开关(netease, kuwo, qqmusic, qishui) |
31
31
 
32
32
  ### 消息格式
33
33
  | 配置项 | 类型 | 默认值 | 说明 |
@@ -41,7 +41,7 @@ This is a **multi-platform music parsing plugin** developed for the Koishi bot f
41
41
  | `showCoverImage` | boolean | true | 发送封面图片 |
42
42
  | `showMusicVoice` | boolean | false | 音乐链接以语音形式发送 |
43
43
  | `showMusicVoiceFile` | boolean | true | 音乐链接是否以语音形式发送(关闭则只发送链接) |
44
- | `forceDownloadMusicVoice` | boolean | true | 强制下载音乐语音(推荐开启,避免直链失效) |
44
+ | `forceDownloadMusicVoice` | boolean | true | 强制下载音乐语音(推荐开启,避免链接失效) |
45
45
  | `forceDownloadImage` | boolean | false | 强制下载封面图片 |
46
46
 
47
47
  ### 性能与限制
@@ -52,18 +52,14 @@ This is a **multi-platform music parsing plugin** developed for the Koishi bot f
52
52
  | `mediaDownloadTimeout` | number | 120000 | 统一下载超时 (ms) |
53
53
  | `maxMediaSize` | number | 0 | 最大下载文件大小 (MB),0 为不限制 |
54
54
  | `downloadEngine` | string | internal | 下载引擎(internal / aria2 / downloads) |
55
- | `aria2Host` | string | 127.0.0.1 | aria2 RPC 地址 |
56
- | `aria2Port` | number | 6800 | aria2 RPC 端口 |
57
- | `aria2Secret` | string | | aria2 RPC 密钥 |
58
- | `resumeDownload` | boolean | true | 启用断点续传(仅 aria2) |
59
55
 
60
56
  ### 网络与请求
61
57
  | 配置项 | 类型 | 默认值 | 说明 |
62
58
  |--------|------|--------|------|
63
59
  | `timeout` | number | 180000 | API 超时 (ms) |
64
- | `videoSendTimeout` | number | 180000 | 消息发送超时 (ms) |
60
+ | `videoSendTimeout` | number | 180000 | 发送超时 (ms) |
65
61
  | `userAgent` | string | 见预设 | User-Agent |
66
- | `proxy` | object | | HTTP/HTTPS 代理 |
62
+ | `proxy` | object | ... | HTTP/HTTPS 代理 |
67
63
  | `customHeaders` | array | [] | 自定义请求头 |
68
64
 
69
65
  ### 发送与重试
@@ -81,13 +77,13 @@ This is a **multi-platform music parsing plugin** developed for the Koishi bot f
81
77
  | `cacheTTL` | number | 600 | 缓存时间 (s) |
82
78
  | `cacheDir` | string | ./temp_cache_music | 统一临时目录 |
83
79
 
84
- ### API 与平台(新增)
80
+ ### API 与平台
85
81
  | 配置项 | 类型 | 默认值 | 说明 |
86
82
  |--------|------|--------|------|
87
- | `platformDedicatedFirst` | object | 全关 | 优先使用专属 API(每个平台可单独设定) |
88
- | `customApis` | array | [] | 覆盖内置平台 API(支持自定义 URL、API Key 认证、字段映射) |
89
- | `customPlatforms` | array | [] | 自定义新平台(可设定关键词匹配、独立代理、字段映射) |
90
- | `globalFieldMapping` | string | 预设 | 全局字段映射 JSON,适配不同 API 返回结构 |
83
+ | `platformDedicatedFirst` | object | 全关 | 优先使用专属 API |
84
+ | `customApis` | array | [] | 覆盖内置平台 API |
85
+ | `customPlatforms` | array | [] | 自定义新平台 |
86
+ | `globalFieldMapping` | string | 预设 | 全局字段映射 JSON |
91
87
 
92
88
  ### 界面文本
93
89
  | 配置项 | 类型 | 默认值 | 说明 |
@@ -96,66 +92,56 @@ This is a **multi-platform music parsing plugin** developed for the Koishi bot f
96
92
  | `unsupportedPlatformText` | string | 暂不支持该平台音乐链接 | 不支持提示 |
97
93
  | `invalidLinkText` | string | 无效的音乐链接 | 无效链接提示 |
98
94
  | `parseErrorPrefix` | string | ❌ 解析失败: | 错误前缀 |
99
- | `parseErrorItemFormat` | string | 见预设 | 错误格式 |
95
+ | `parseErrorItemFormat` | string | 【${url}】: ${msg} | 错误格式 |
100
96
 
101
97
  ## 支持的变量 (Supported Variables)
102
98
  在 `unifiedMessageFormat` 中可使用以下变量,空行自动隐藏:
103
99
 
104
100
  | 变量名 | 说明 |
105
101
  |--------|------|
106
- | `${name}` | 歌曲名称 |
107
- | `${artist}` | 歌手名称 |
108
- | `${album}` | 专辑名称 |
109
- | `${cover}` | 封面图片链接 |
110
- | `${music_url}` | 音乐直链 |
111
- | `${level}` | 音质等级 |
102
+ | `${name}` | 歌曲名 |
103
+ | `${artist}` | 歌手 |
104
+ | `${album}` | 专辑 |
105
+ | `${level}` | 音质 |
112
106
  | `${size}` | 文件大小 |
113
107
 
114
- ## 解析策略 (Parsing Strategy)
115
- 1. **独立接口优先**:每个平台默认使用专属接口(网易云、酷我、QQ、汽水)
116
- 2. **聚合接口备用**:当解析网易云或 QQ 音乐失败时,自动调用统一聚合接口 `https://api.bugpk.com/api/music` 进行补提
117
- 3. **自定义优先**:若配置了自定义 API 并开启“优先使用专属 API”,则会优先尝试自定义地址
118
- 4. **智能扩展名识别**:下载音频时,会优先从链接的 `mime_type` 参数(如汽水音乐)识别真实格式,支持 mp3/m4a/flac/wav/ogg/aac/opus/wma/ape/wv/alac 等常见格式
119
-
120
108
  ## 依赖说明 (Dependencies)
121
109
  ### 音乐语音(可选)
122
- 若启用 `showMusicVoice`,推荐安装以下可选插件以获得更好的语音格式支持:
110
+ 若启用 `showMusicVoice`,请安装:
123
111
  - `koishi-plugin-silk`:silk 编解码
124
112
  - `koishi-plugin-ffmpeg`:音频重采样
125
- 未安装时仍可尝试直接发送音频链接,但可能受平台限制。
126
-
127
113
  ### aria2 下载引擎(可选)
128
- 若启用 `downloadEngine: 'aria2'`,请安装并启动 aria2 服务,并安装 npm 包 `aria2`:
129
- - 安装 aria2 服务端:https://github.com/aria2/aria2
130
- - 安装 npm 客户端:`npm install aria2`
131
- - 启动 RPC:`aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all`
132
- 未满足条件时自动降级为内置下载,不影响正常使用。
133
-
114
+ 若启用 `downloadEngine: 'aria2'`,请安装可选依赖 `koishi-plugin-aria2-plus` 并配置该插件连接 aria2 服务。插件启动时会自动检测该服务,未安装或不可用时将降级为内置下载,不影响正常使用。
134
115
  ### downloads 服务(可选)
135
116
  若启用 `downloadEngine: 'downloads'`,请安装可选依赖 `koishi-plugin-downloads`,失败时回退到内置下载。
136
117
 
137
118
  ## 支持的平台 (Supported Platforms)
138
- | 平台名称 | 关键词识别 | 解析能力 |
139
- |----------|------------|----------|
140
- | 网易云音乐 | music.163.com, 163cn.tv | 歌曲信息、SVIP高音质直链、封面 |
141
- | 酷我音乐 | kuwo.cn | 歌曲信息、直链、封面 |
142
- | QQ音乐 | y.qq.com, i.y.qq.com | 歌曲信息、直链、封面 |
143
- | 汽水音乐 | qishui.douyin.com | 歌曲信息、高音质直链、封面 |
144
- | 🧩 自定义平台 | 通过 `customPlatforms` 添加 | 取决于 API |
119
+
120
+ | 平台名称 | 示例链接 | 解析能力 |
121
+ |----------|----------|----------|
122
+ | 网易云音乐 | `https://music.163.com/song?id=...` | 歌曲、歌单(单曲) |
123
+ | 酷我音乐 | `https://www.kuwo.cn/play_detail/...` | 歌曲 |
124
+ | QQ音乐 | `https://y.qq.com/n/ryqq/songDetail/...` | 歌曲 |
125
+ | 汽水音乐 | `https://qishui.douyin.com/s/...` | 歌曲 |
126
+ | 🔧 自定义平台 | 通过 `customPlatforms` 配置添加 | 取决于提供的 API |
145
127
 
146
128
  ## 项目贡献者 (Contributors)
147
- | 贡献者 | 贡献内容 |
148
- |--------|----------|
149
- | Minecraft-1314 | 插件完整开发 |
150
- | 梦安大佬 | 赞助恢复网易云SVIP接口 |
151
- | JH-Ahua | BugPk-Api 支持 |
129
+
130
+ | 贡献者 (Contributor) | 贡献内容 (Contribution) |
131
+ |----------------------|-------------------------|
132
+ | Minecraft-1314 | 插件完整开发 (Complete plugin development) |
133
+ | BugPk-Api | API 支持 |
152
134
 
153
135
  (欢迎通过 Issues 或 PR 加入贡献者列表)
154
136
 
155
137
  ## 许可协议 (License)
138
+
156
139
  本项目采用 MIT 许可证,详情参见 [LICENSE](LICENSE) 文件。
140
+
157
141
  This project is licensed under the MIT License, see the [LICENSE](LICENSE) file for details.
158
142
 
159
143
  ## 支持我们 (Support Us)
144
+
160
145
  如果这个项目对您有帮助,欢迎点亮右上角的 Star ⭐ 支持我们!
161
- If this project is helpful to you, please feel free to star it in the upper right corner ⭐ to support us!
146
+
147
+ If this project is helpful to you, please feel free to star it in the upper right corner ⭐ to support us!