Commit Graph
210 Commits
Author SHA1 Message Date
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
real-zony 41cba02833 feat: NetEase Cloud Music playlist download supports passing in multiple IDs.
Issue: https://github.com/real-zony/ZonyLrcToolsX/issues/139
2023-05-24 21:54:13 +08:00
real-zony 98c935ed93 fix: Fixed the issue where incorrect artist names were obtained when downloading NetEase Cloud Music playlists. 2023-05-24 20:50:24 +08:00