Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
TaurusXin | c4e132758e | |
TaurusXin | 22768594ba | |
TaurusXin | 6af854b376 | |
TaurusXin | ed6c05b4bf | |
TaurusXin | dc2830d5c3 |
|
@ -5,3 +5,5 @@ ncmdump
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
build
|
build
|
||||||
|
|
||||||
|
cmake-build-*
|
|
@ -48,19 +48,19 @@ ncmdump -v
|
||||||
ncmdump 1.ncm 2.ncm...
|
ncmdump 1.ncm 2.ncm...
|
||||||
```
|
```
|
||||||
|
|
||||||
你可以使用 `-d` 参数来指定一个文件夹,对文件夹下的所有以 ncm 为扩展名的文件进行批量处理
|
使用 `-d` 参数来指定一个文件夹,对文件夹下的所有以 ncm 为扩展名的文件进行批量处理
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ncmdump -d source_dir
|
ncmdump -d source_dir
|
||||||
```
|
```
|
||||||
|
|
||||||
你可以使用 `-r` 配合 `-d` 参数来递归处理文件夹下的所有以 ncm 为扩展名的文件
|
使用 `-r` 配合 `-d` 参数来递归处理文件夹下的所有以 ncm 为扩展名的文件
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ncmdump -d source_dir -r
|
ncmdump -d source_dir -r
|
||||||
```
|
```
|
||||||
|
|
||||||
你可以使用 `-o` 参数来指定输出目录,将转换后的文件输出到指定目录,该参数支持与 `-r` 参数一起使用
|
使用 `-o` 参数来指定输出目录,将转换后的文件输出到指定目录,该参数支持与 `-r` 参数一起使用
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 处理单个或多个文件并输出到指定目录
|
# 处理单个或多个文件并输出到指定目录
|
||||||
|
|
|
@ -47,7 +47,7 @@ private:
|
||||||
NcmFormat mFormat;
|
NcmFormat mFormat;
|
||||||
std::string mImageData;
|
std::string mImageData;
|
||||||
std::ifstream mFile;
|
std::ifstream mFile;
|
||||||
unsigned char mKeyBox[256];
|
unsigned char mKeyBox[256]{};
|
||||||
NeteaseMusicMetadata* mMetaData;
|
NeteaseMusicMetadata* mMetaData;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -224,7 +224,7 @@ void NeteaseCrypt::FixMetadata()
|
||||||
audioFile = new TagLib::MPEG::File(mDumpFilepath.c_str());
|
audioFile = new TagLib::MPEG::File(mDumpFilepath.c_str());
|
||||||
tag = dynamic_cast<TagLib::MPEG::File *>(audioFile)->ID3v2Tag(true);
|
tag = dynamic_cast<TagLib::MPEG::File *>(audioFile)->ID3v2Tag(true);
|
||||||
|
|
||||||
if (mImageData.length() > 0)
|
if (!mImageData.empty())
|
||||||
{
|
{
|
||||||
TagLib::ID3v2::AttachedPictureFrame *frame = new TagLib::ID3v2::AttachedPictureFrame;
|
TagLib::ID3v2::AttachedPictureFrame *frame = new TagLib::ID3v2::AttachedPictureFrame;
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ void NeteaseCrypt::FixMetadata()
|
||||||
audioFile = new TagLib::FLAC::File(mDumpFilepath.c_str());
|
audioFile = new TagLib::FLAC::File(mDumpFilepath.c_str());
|
||||||
tag = audioFile->tag();
|
tag = audioFile->tag();
|
||||||
|
|
||||||
if (mImageData.length() > 0)
|
if (!mImageData.empty())
|
||||||
{
|
{
|
||||||
TagLib::FLAC::Picture *cover = new TagLib::FLAC::Picture;
|
TagLib::FLAC::Picture *cover = new TagLib::FLAC::Picture;
|
||||||
cover->setMimeType(mimeType(mImageData));
|
cover->setMimeType(mimeType(mImageData));
|
||||||
|
@ -257,7 +257,7 @@ void NeteaseCrypt::FixMetadata()
|
||||||
tag->setAlbum(TagLib::String(mMetaData->album(), TagLib::String::UTF8));
|
tag->setAlbum(TagLib::String(mMetaData->album(), TagLib::String::UTF8));
|
||||||
}
|
}
|
||||||
|
|
||||||
tag->setComment(TagLib::String("Create by taurusxin/ncmdump.", TagLib::String::UTF8));
|
// tag->setComment(TagLib::String("Create by taurusxin/ncmdump.", TagLib::String::UTF8));
|
||||||
|
|
||||||
audioFile->save();
|
audioFile->save();
|
||||||
audioFile->~File();
|
audioFile->~File();
|
||||||
|
@ -301,7 +301,7 @@ void NeteaseCrypt::Dump(std::string const &outputDir = "")
|
||||||
mFormat = NeteaseCrypt::FLAC;
|
mFormat = NeteaseCrypt::FLAC;
|
||||||
}
|
}
|
||||||
|
|
||||||
output.open(mDumpFilepath, output.out | output.binary);
|
output.open(mDumpFilepath, std::ofstream::out | std::ofstream::binary);
|
||||||
}
|
}
|
||||||
|
|
||||||
output.write((char *)buffer.data(), n);
|
output.write((char *)buffer.data(), n);
|
||||||
|
|
2
taglib
2
taglib
|
@ -1 +1 @@
|
||||||
Subproject commit 0896fb90920c125e55248360d271d1a1674e2a4d
|
Subproject commit e3de03501ff66221d1f1f971022b248d5b38ba06
|
Loading…
Reference in New Issue