Compare commits
17 Commits
1.3.2
...
b9299d8988
| Author | SHA1 | Date | |
|---|---|---|---|
| b9299d8988 | |||
|
84b5c0044d
|
|||
|
f060bee5ad
|
|||
|
bc5719ac11
|
|||
|
5e41d41874
|
|||
|
3906a49f7a
|
|||
|
67cba29a8f
|
|||
| 2e5fc75fee | |||
|
|
f58c6c3880 | ||
|
|
2b52a367f2 | ||
| 36e6801f29 | |||
| 2cd7d69aa5 | |||
| 1aaaab10dc | |||
| e04415db9b | |||
| 911beb25bc | |||
| 0a6ac353ff | |||
| f89ea7eab6 |
44
.github/ISSUE_TEMPLATE/bug_report.md
vendored
44
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,31 +1,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a bug report to help us improve
|
||||
title: "[Bug] Summarize the bug here"
|
||||
name: "[请按照此模板填写] 报告 Bug"
|
||||
about: "创建一个 Bug 报告,不按照模板的 Issue 会被关闭。"
|
||||
title: "[Bug] 总结你的 Bug 报告"
|
||||
labels: bug
|
||||
assignees: taurusxin
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
**Bug 描述**
|
||||
清晰地描述一下 Bug 的大致问题。
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
**复现方法**
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
复现此 Bug 的方法
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
1. 打开 '...'
|
||||
2. 点击 '....'
|
||||
3. 发生报错
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. Windows 11]
|
||||
**预期行为**
|
||||
|
||||
解释一下原本应该出现的结果。
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
**屏幕截图**
|
||||
|
||||
如果可以,屏幕截图可以更好地阐述你的问题。
|
||||
|
||||
**环境**
|
||||
|
||||
- OS: [e.g. Windows 11]
|
||||
- 软件版本: [e.g. 1.3.2]
|
||||
|
||||
**附加内容**
|
||||
|
||||
添加更多其他内容以帮助开发者更好地了解这个 Bug。
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[Feature] Summarize new feature here"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
41
.github/workflows/autobuild.yml
vendored
41
.github/workflows/autobuild.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows amd64 Build - MinGW
|
||||
name: windows_amd64_build_msys2_exe
|
||||
path: ${{ env.BUILD_PATH }}/ncmdump.exe
|
||||
|
||||
build_on_windows_msvc:
|
||||
@@ -56,16 +56,16 @@ jobs:
|
||||
- name: Upload artifact executable
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows amd64 Build - MSVC
|
||||
name: windows_amd64_build_msvc_exe
|
||||
path: ${{ env.BUILD_PATH }}/${{ env.BUILD_TYPE }}/ncmdump.exe
|
||||
|
||||
- name: Upload artifact DLL
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows amd64 Build - MSVC DLL
|
||||
name: windows_amd64_build_msvc_dll
|
||||
path: ${{ env.BUILD_PATH }}/${{ env.BUILD_TYPE }}/libncmdump.dll
|
||||
|
||||
build_on_linux:
|
||||
build_on_linux_amd64:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -88,10 +88,10 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Linux amd64 Build
|
||||
name: linux_build_amd64
|
||||
path: ${{ env.BUILD_PATH }}/ncmdump
|
||||
|
||||
build_on_macos:
|
||||
build_on_macos_amd64:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
@@ -105,7 +105,7 @@ jobs:
|
||||
brew install git cmake
|
||||
|
||||
- name: Configure build
|
||||
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }}
|
||||
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }} -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{ env.BUILD_PATH }} -j 4
|
||||
@@ -113,5 +113,30 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macOS amd64 Build
|
||||
name: macOS_build_amd64
|
||||
path: ${{ env.BUILD_PATH }}/ncmdump
|
||||
|
||||
build_on_macos_arm64:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install git cmake
|
||||
|
||||
- name: Configure build
|
||||
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }} -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{ env.BUILD_PATH }} -j 4
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macOS_build_arm64
|
||||
path: ${{ env.BUILD_PATH }}/ncmdump
|
||||
10
README.md
10
README.md
@@ -16,9 +16,13 @@
|
||||
|
||||
## 使用
|
||||
|
||||
注意:自网易云音乐 3.0 版本开始,下载的 ncm 文件均不内置歌曲专辑的封面图片,需要从网络获取,介于在一个小工具中嵌入庞大网络库的非必要性,可以移步我的另一个仓库(<https://git.taurusxin.com/taurusxin/ncmdump-go>),下载完全使用 Golang 重写的新版本,支持从网络自动获取封面图并嵌入到目标音乐文件。
|
||||
|
||||
### 命令行工具
|
||||
|
||||
你可以使用 Homebrew 来安装 ncmdump 的 cli 版本
|
||||
**[不推荐]** 你可以使用 Homebrew 来安装 Linux 或者 macOS 下的 ncmdump
|
||||
|
||||
注意:由于本项目依赖的库 taglib 的 2.0 版本尚未发布到 homebrew-core(主要是因为 taglib 2.0 导致其他 brew 包存在版本兼容问题),目前的 cmake 构建链无法在 macOS 上正常使用。根据 brew 的要求,如果依赖库已有官方的 brew 包,构建时必须使用官方仓库中的包,不能从 git 获取。而 taglib 2.0 版本开始才支持 cmake 构建。因此,ncmdump 在 homebrew 上只能发布到 `1.2.1` 版本。建议直接通过二进制方式安装,`1.3.0` 后版本修复了许多 bug,使用体验会更好。
|
||||
|
||||
```shell
|
||||
brew install ncmdump
|
||||
@@ -76,6 +80,10 @@ cmake -G "Visual Studio 17 2022" -A x64 -B build
|
||||
|
||||
# Linux / macOS
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -B build
|
||||
|
||||
# 如果需要在 macOS 下交叉编译,可以指定 `CMAKE_OSX_ARCHITECTURES` 变量来指明目标系统架构
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -B build # arm64
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 -B build # Intel-based
|
||||
```
|
||||
|
||||
编译项目
|
||||
|
||||
@@ -35,7 +35,7 @@ void processFile(const fs::path &filePath)
|
||||
crypt.Dump();
|
||||
crypt.FixMetadata();
|
||||
|
||||
std::cout << BOLDGREEN << "Done: " << RESET << "'" << crypt.dumpFilepath().u8string() << "'" << std::endl;
|
||||
std::cout << BOLDGREEN << "[Done] " << RESET << "'" << filePath.u8string() << "' -> '" << crypt.dumpFilepath().u8string() << "'" << std::endl;
|
||||
}
|
||||
catch (const std::invalid_argument &e)
|
||||
{
|
||||
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
|
||||
if (i + 1 < argc && argv[i + 1][0] != '-')
|
||||
{
|
||||
folderProvided = true;
|
||||
processFilesInFolder(argv[i + 1]);
|
||||
processFilesInFolder(fs::u8path(argv[i + 1]));
|
||||
// Skip the folder name
|
||||
++i;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "aes.h"
|
||||
#include "base64.h"
|
||||
#include "cJSON.h"
|
||||
#include "color.h"
|
||||
|
||||
#define TAGLIB_STATIC
|
||||
#include "taglib/toolkit/tfile.h"
|
||||
@@ -358,7 +359,7 @@ NeteaseCrypt::NeteaseCrypt(std::string const &path)
|
||||
|
||||
if (n <= 0)
|
||||
{
|
||||
std::cout << "[Warn] " << path << " missing metadata infomation can't fix some infomation!" << std::endl;
|
||||
std::cout << BOLDYELLOW << "[Warn] " << RESET << "'" << path << "' missing metadata infomation can't fix some infomation!" << std::endl;
|
||||
|
||||
mMetaData = NULL;
|
||||
}
|
||||
@@ -391,23 +392,24 @@ NeteaseCrypt::NeteaseCrypt(std::string const &path)
|
||||
mMetaData = new NeteaseMusicMetadata(cJSON_Parse(modifyDecryptData.c_str()));
|
||||
}
|
||||
|
||||
// skip crc32 & unuse charset
|
||||
if (!mFile.seekg(9, mFile.cur))
|
||||
// skip crc32 & image version
|
||||
if (!mFile.seekg(5, mFile.cur))
|
||||
{
|
||||
throw std::invalid_argument("can't seek file");
|
||||
}
|
||||
|
||||
uint32_t cover_frame_len{0};
|
||||
read(reinterpret_cast<char *>(&cover_frame_len), 4);
|
||||
read(reinterpret_cast<char *>(&n), sizeof(n));
|
||||
|
||||
if (n > 0)
|
||||
{
|
||||
char *imageData = (char *)malloc(n);
|
||||
read(imageData, n);
|
||||
|
||||
mImageData = std::string(imageData, n);
|
||||
mImageData = std::string(n, '\0');
|
||||
read(&mImageData[0], n);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "[Warn] " << path << " missing album can't fix album image!" << std::endl;
|
||||
std::cout << BOLDYELLOW << "[Warn] " << RESET << "'" << path << "' missing album can't fix album image!" << std::endl;
|
||||
}
|
||||
mFile.seekg(cover_frame_len - n, mFile.cur);
|
||||
}
|
||||
|
||||
BIN
test/expect.bin
BIN
test/expect.bin
Binary file not shown.
Reference in New Issue
Block a user