aL1CesT
|
9cda87dbfe
|
feat(desktop): 保存配置时不再重写整个 config.yaml
桌面端从共享的 DI 容器拿配置对象,再用 YamlDotNet 的序列化器整份写回。这样
一轮往返会把文件重写一遍:仓库里那 60 行、注释众多的 config.yaml 会变成 40
行机器生成的块,注释全没了,多行值的引号风格也变了。只要在设置页动一个开关,
注释就丢了。
SettingsStore 不再重新序列化整个文档,只补丁 UI 真正拥有的那几个键:
- PatchText 按行扫描 YAML,用缩进栈跟踪每个受管键的路径
(networkOptions.isEnable、provider.lyric.plugin[NetEase].priority …),
只替换那个标量,其余每一个字节 —— 注释、空行、列对齐 —— 保持原样。带
引号的值保持原引号风格(QuotedScalarEventEmitter 沿用原文样式)。
- 补丁后的文本会被重新解析,并逐字段与预期值比对,通过才落盘。往返不一致
就拒绝写入,磁盘上的文件保持不动。另有重新生成整份文件的兜底路径,用于
原文件已被替换成补丁器无法跟随的内容时。
同一提交里还有:
- AppPaths:可执行文件所在目录可写时配置就放那里(便携安装),否则回退到
%AppData%/ZonyLrcTools。写入走临时文件 + File.Move,崩溃不会留下半份配置。
- NetEaseSessionStore / KugouDatabaseStore:两个小 JSON,分别存网易云登录
cookie 和用户手动指定的 KGMusicV3.db 路径。刻意与 config.yaml 分开 ——
它们是机器状态而不是用户偏好,也不该出现在设置的 diff 里。
- ConfigurationServiceCollectionExtensions:构造与 CLI 相同的 GlobalOptions,
但基于上面解析出的路径,而不是固定的 AppContext.BaseDirectory。
Common 为此一行未改:CLI 照旧从自己所在目录读 config.yaml。
|
2026-11-09 04:27:42 +08:00 |
|
aL1CesT
|
4ec67b9ee0
|
feat(scanner): 让网易云歌单扫描器能在终端之外使用
网易云的扫描器是照着 CLI 的场景写的:把登录二维码画成 ASCII 艺术丢进日志,
然后在一个没有上限的循环里等待。这在终端里没问题,在别处都不行:GUI 无法
呈现那块 ASCII 图形,看不到登录进行到哪一步,也没法取消等待。
NetEaseMusicSongListMusicScanner 的改动:
- LoginAsync 增加可选回调,收到结构化的 NetEaseQrCodePayload(二维码内容、
unikey、以及 ASCII 渲染结果)。传了回调就跳过 ASCII 那一步;不传(CLI
正是如此)时原有的日志输出完全不变,download -sc netease 的行为与改动前
一致。
- 增加可选的 Action<NetEaseLoginState>,汇报中间状态(等待扫码 / 已扫码
未确认 / 成功 / 二维码过期),而不是只留一个会阻塞到底的 await。
- 每个循环、每次 HTTP 调用都接受 CancellationToken,关掉二维码窗口就能真的
中止扫描。
- Cookie 与 CsrfToken 从私有字段改成公开属性,调用方可以跨重启恢复会话,
不必每次启动都扫码。同时补上 RestoreLoginState / ClearLoginState /
IsLoggedIn。
- 登录失败原先抛 ErrorCodes.NotSupportedFileEncoding,这个错误码与实际情况
毫无关系。改为 UnableGetSongListFromNetEaseCloudMusic。
CsvFileMusicScanner 另有一个解析缺陷:它按 Environment.NewLine 切行,而
Windows 上那是 "\r\n"。从网页导出、或从 git 里签出的 CSV 通常是纯 "\n",
于是整个文件被当成一行,跳过表头之后就是空的,界面上表现为"解析了却一首歌
都没有"。改成同时按两个字符切分即可;过短的行也不再抛异常。
|
2026-11-09 04:27:42 +08:00 |
|
aL1CesT
|
168a8e42f1
|
feat(decrypt): 支持酷狗 .kgg 格式
原先的解密依赖 MusicDecrypto.Library,它支持 ncm/qmc/kgm/kgma/kwm,但任何
版本都不支持 .kgg,这类文件会被直接拒绝。
.kgg 不是自包含的:音频用 QMC2 加密,而每个文件的 ekey 并不存放在文件里。
文件里只有偏移 0x48 处的 32 字节音频哈希;对应的 ekey 在酷狗客户端的
KGMusicV3.db(表 ShareFileItems)里,而这个数据库本身也是逐页加密的。
所以必须先读数据库:
1. 逐页解密 KGMusicV3.db(AES-128-CBC,key/IV 由主密钥和页号派生)
2. 用文件的音频哈希查出 ekey
3. 解码 ekey(TC-TEA CBC,含 V2 两段式变体)
4. 构造 QMC2 解密器(短密钥用映射表,长密钥用 RC4)
5. 按 1 MB 分块流式解密音频
6. 读解密后的头 4 个字节判断真实扩展名(fLaC / OggS / 否则 mp3)
实际后果:.kgg 只能在本机解密,因为那条 ekey 记录只有在酷狗客户端下载过
这首歌时才会写入。别人给的 .kgg 解不了。
新增内容:
- Common/MusicDecryption/Kugou/ —— TcTea、EkeyDecoder、Qmc2Cipher、
KugouEkeyDatabase、KggMusicDecryptor
- IKugouKeyProvider / KugouKeyProvider —— 探测数据库、缓存已解析的密钥表、
支持手动指定数据库路径
- IMusicDecryptor.ConvertMusicAsync 增加可选 CancellationToken,让大文件真的
能被中断(桌面端有"停止"按钮)
- 输出先写 .part,校验字节数之后才改名,中途中断不会留下一个看起来完成
了的残缺文件
注意:
- Microsoft.Data.Sqlite 会传递引入 SQLitePCLRaw.lib.e_sqlite3 2.1.11,该版本
被 NU1903 / GHSA-2m69-gcr7-jv3q 标记。显式引用
SQLitePCLRaw.bundle_e_sqlite3 3.0.5 覆盖掉它。
- e_sqlite3.dll 是原生依赖,单文件发布会把它留在 exe 外面,必须随包分发。
酷狗算法移植自 MIT 协议的 kgg-dec 参考实现,因此 THIRD-PARTY-NOTICES.md
带上原始版权与许可声明,每个移植文件头部也标了来源。
|
2026-11-09 04:27:41 +08:00 |
|
aL1CesT
|
1c0f8e8d3a
|
fix: 一个坏文件不再中断整批任务
三个问题会让单个坏文件毁掉整次任务:
1. LoggerHelper.LogWarningInfo 在错误码小于 50000 时会把异常重新抛出。
而这个方法的所有调用点都在 catch 块里,异常于是穿透调用方的 catch,
整批任务就此中断。现在它只负责记录,要不要往上抛由调用方决定。
2. LyricsDownloader 把"这个源没返回歌词"当成了"这首歌是纯音乐":它把
IsSuccessful 置为 true 并跳出 provider 循环,后面的源根本没被问到。
现在只有真正拿到歌词才算成功;空结果会继续问下一个源,所有源都为空
才判为跳过。
3. LyricsDownloader 在写文件之前就把这一首标成成功。当配置的
fileEncoding 非法时,写入抛异常、异常被记进日志,而这一首仍然报告
成功 —— 磁盘上留下 0 字节的 .lrc,界面上却是绿色。现在先做编码转换
再建文件,失败时不留空壳,也如实报告失败。
顺带:
- IAlbumDownloader / AlbumDownloader 增加可选的逐首回调,调用方据此可以
渲染进度;CLI 不传,行为不变。
- AlbumDownloader 不再在封面真正写盘之前记成功日志(原先它永远把所有
曲目都算作成功)。
- 各下载循环补上 WarpTask 的释放;回调抛出的异常会被捕获并记录,不再
掀翻整次运行。
|
2026-11-09 04:27:41 +08:00 |
|
real-zony
|
f95c40ca52
|
chore: fine-tune UI.
|
2026-03-03 15:34:26 +08:00 |
|
real-zony
|
4f4398acc8
|
feat: Implement lyrics download feature.
|
2026-03-03 12:07:28 +08:00 |
|
real-zony
|
1f7414ead3
|
feat: Create a new GUI project based on Avalonia. (Powered by Claude)
|
2026-01-09 23:38:57 +08:00 |
|
real-zony
|
00e2118645
|
feat: Introduce localization features.
|
2026-01-09 23:37:20 +08:00 |
|
real-zony
|
a39302dfb7
|
ci: Fix ci build issue.
.NET / build-linux-windows (push) Has been cancelled
.NET / build-macos (push) Has been cancelled
.NET / release (push) Has been cancelled
|
2026-01-09 00:25:01 +08:00 |
|
real-zony
|
7919147e4f
|
build: Upgrade dotnet version to 10.0 and update the dependent package version.
|
2026-01-09 00:09:13 +08:00 |
|
real-zony
|
c89b79fda6
|
build: Upgraded package version.
|
2025-07-25 22:27:24 +08:00 |
|
real-zony
|
c3d98d60b5
|
fix: Fixed the garbled text issue caused by the CSV file encoding. (#156)
|
2024-12-15 15:20:33 +08:00 |
|
real-zony
|
7732ab52d3
|
refactor: Removed avalonia code.
|
2024-11-29 22:54:38 +08:00 |
|
real-zony
|
9ab9cd50e2
|
feat: Mostly completed bidirectional binding for settings page and configuration.
|
2024-07-03 23:38:33 +08:00 |
|
real-zony
|
e66ef89e7a
|
build: Upgrade the YamlDotNet version.
|
2024-07-02 21:51:55 +08:00 |
|
real-zony
|
8b5d5c64b0
|
refactor: Adjusted the structure of the configuration file.
BREAKING CHANGE: Adjusted the internal structure of the config.yaml file, removed the top-level hierarchy.
|
2024-07-02 21:22:40 +08:00 |
|
real-zony
|
2dca5239f5
|
fix: Fixed exception throw when NumericUpDown is empty.
|
2024-07-02 21:00:03 +08:00 |
|
real-zony
|
d5689164b5
|
fix(Fixed some issues in the settings page.):
|
2024-07-02 18:27:52 +08:00 |
|
real-zony
|
b57739f543
|
feat: Completed the adjustments and bindings of global settings.
|
2024-07-02 10:43:23 +08:00 |
|
real-zony
|
a2c44901fd
|
refactor: Fixed incorrect naming.
|
2024-06-30 22:02:33 +08:00 |
|
real-zony
|
6ad2992144
|
feat: Added some UI animation effects.
|
2024-06-30 21:58:41 +08:00 |
|
real-zony
|
3b0c55ac00
|
feat: Completed the download lyrics feature.
|
2024-06-30 17:52:12 +08:00 |
|
real-zony
|
81bf6ebe3f
|
refactor: Adjusted the view model to support reactive programming.
|
2024-06-30 17:51:53 +08:00 |
|
real-zony
|
aa3c45101b
|
feat: Added a comparator for MusicInfo.
|
2024-06-30 17:50:49 +08:00 |
|
real-zony
|
d00d735bf0
|
feat: When downloading lyrics, a callback was added to facilitate UI updates.
|
2024-06-30 17:50:26 +08:00 |
|
real-zony
|
7fa595a71b
|
refactor: Removed unused styles.
|
2024-06-28 15:13:00 +08:00 |
|
real-zony
|
4f15d06e63
|
feat: Added a settings page.
|
2024-06-28 15:07:06 +08:00 |
|
real-zony
|
5ccd8a7c53
|
feat: Complete the basic GUI layout.
|
2024-06-28 12:33:14 +08:00 |
|
real-zony
|
14812bceb7
|
refactor: Removed the local server project.
|
2024-06-28 12:29:31 +08:00 |
|
real-zony
|
be538eb650
|
feat: Upgraded the versions of the packages that the project depends on.
|
2024-06-28 12:27:24 +08:00 |
|
real-zony
|
888c7f511b
|
refactor: Removed unused files.
|
2024-06-28 12:23:48 +08:00 |
|
ZaneYork
|
444f4e75a6
|
修复网易云歌曲ID溢出问题
|
2024-05-21 17:41:40 +08:00 |
|
real-zony
|
b6e3cb6038
|
chore: Upgrade version.
|
2023-12-22 14:59:48 +08:00 |
|
real-zony
|
fea5e1124f
|
fix: Fixed the issue where Kuwo Music could not download lyrics.
|
2023-12-22 13:52:28 +08:00 |
|
real-zony
|
06bf733ae9
|
fix: Fixed the issue where logs were not displaying.
|
2023-12-12 22:45:37 +08:00 |
|
real-zony
|
dfe18d8541
|
ci: Fixed the script error.
|
2023-12-12 22:05:12 +08:00 |
|
real-zony
|
243a0e2559
|
fix: Fixed the issue where NetEase Cloud Music could not download lyrics.
|
2023-12-12 21:56:49 +08:00 |
|
real-zony
|
8d946ebbd5
|
build: Upgraded the dependency framework to .NET 8.0.
|
2023-12-12 19:22:50 +08:00 |
|
Travis Lee
|
14c78f9a83
|
feat: build arm64 binaries
|
2023-12-11 15:36:12 +08:00 |
|
Travis Lee
|
b9d6da5f72
|
feat: support file extensions m4a, ogg and opus
|
2023-12-11 15:35:55 +08:00 |
|
real-zony
|
c8ffbc55af
|
fix: Fixed the issue mentioned in #145.
Added a new line break.('\n')
|
2023-09-11 09:49:02 +08:00 |
|
real-zony
|
4e1c4d1519
|
chore: Corrected description information.
|
2023-08-13 21:25:43 +08:00 |
|
real-zony
|
7f81a3edea
|
refactor: Managed dependencies with unified package management.
|
2023-07-14 21:20:01 +08:00 |
|
real-zony
|
24624a6d21
|
feat: Added Avalonia UI project.
|
2023-07-14 19:01:53 +08:00 |
|
real-zony
|
d860632327
|
chore: Removed the frontend web page code.
|
2023-07-14 19:01:25 +08:00 |
|
real-zony
|
b240564cf7
|
perf: Optimized the startup time of the tool.
|
2023-05-25 09:05:39 +08:00 |
|
real-zony
|
6e2848a9de
|
chore: Updated the version number.
|
2023-05-24 23:14:57 +08:00 |
|
real-zony
|
6361bf9265
|
feat: Improved the result information for lyrics download.
|
2023-05-24 23:08:17 +08:00 |
|
real-zony
|
383e2c5939
|
chore: Fix compilation warning messages.
|
2023-05-24 22:57:55 +08:00 |
|
real-zony
|
1e5c41852f
|
perf: An error log file will only be created when there are songs that failed to download.
|
2023-05-24 22:00:22 +08:00 |
|