magic-akari / ncmc Goto Github PK
View Code? Open in Web Editor NEWconvert encrypted file to original music file
License: MIT License
convert encrypted file to original music file
License: MIT License
Fail to compile under Windows:
> cargo install ncmc
Updating crates.io index
Installing ncmc v0.1.10
error: failed to compile `ncmc v0.1.10`, intermediate artifacts can be found at `C:\Users\xytao\AppData\Local\Temp\cargo-installv5FHL8`
Caused by:
failed to select a version for the requirement `aes = "^0.3.2"`
candidate versions found which didn't match: 0.7.5, 0.7.4, 0.7.3, ...
location searched: crates.io index
required by package `ncmc v0.1.10`
Turns out that aes 0.3.2 got yanked and can't be installed. We should probably update the README to use cargo install --locked
or update the dependencies.
songs list:
http://music.163.com/m/song?id=1302132211&userid=1151411
http://music.163.com/m/song?id=19526921&userid=1151411
http://music.163.com/m/song?id=18529562&userid=1151411
1 <- C:\Users\isy\Desktop\ncmc-v0.1.6-x86_64-pc-windows-gnu\Can't Help Falling in Love - Kina Grannis.ncm
thread 'main' panicked at 'slice index starts at 22 but ends at 0', libcore\slice\mod.rs:2340:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
I noticed that if I run ncmc path/to/file.ncm
twice, the CLI output is exactly the same. Did the 2nd output overwrite the 1st output, or was the 2nd skipped because output file already existed? Thanks!
{"musicId":"track-343292","musicName":"你好吗?","artist":[["at17","11001"]],"albumId":"33838","album":"Kiss Kiss Kiss" ....
我看 flac 打包的时候也没用到这个 musicId
,是不是干脆解析的时候去掉呢?
diff --git a/crates/ncm_meta/src/music_meta.rs b/crates/ncm_meta/src/music_meta.rs
index 3a44d64..efdb914 100644
--- a/crates/ncm_meta/src/music_meta.rs
+++ b/crates/ncm_meta/src/music_meta.rs
@@ -1,41 +1,13 @@
-use miniserde::{de, make_place, Deserialize};
+use miniserde::Deserialize;
#[derive(Deserialize, Debug)]
#[allow(dead_code)]
pub(crate) struct MusicMeta {
- #[serde(rename = "musicId")]
- pub music_id: MusicId,
#[serde(rename = "musicName")]
pub music_name: String,
- pub artist: Vec<(String, MusicId)>,
+ pub artist: Vec<(String, String)>,
pub album: String,
#[serde(rename = "albumPic")]
pub album_pic: String,
pub format: String,
}
-
-make_place!(Place);
-#[derive(Debug)]
-pub(crate) struct MusicId(u32);
-
-impl de::Visitor for Place<MusicId> {
- fn string(&mut self, s: &str) -> miniserde::Result<()> {
- let value: u32 = s.parse().map_err(|_| miniserde::Error)?;
- self.out = Some(MusicId(value));
-
- Ok(())
- }
-
- fn nonnegative(&mut self, n: u64) -> miniserde::Result<()> {
- let value = n as u32;
- self.out = Some(MusicId(value));
-
- Ok(())
- }
-}
-
-impl de::Deserialize for MusicId {
- fn begin(out: &mut Option<Self>) -> &mut dyn de::Visitor {
- Place::new(out)
- }
-}
comment字段中有163 key,写入工具信息之后播放器就无法识别解码并和网易云的API集成了;而且ID3 v2标准中并没有规定可以使用分号分割不同的comment字段,这意味着所有播放器都是把comment当成普通字符串进行处理的。
或许可以考虑把 Convert by 写入到其他字段里?例如 https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2.2.html#involved-people-list 或者 Producer。
这样方便更新和管理
Useful,thanks!
total: 1
--------------------------------
1 <- test.ncm
thread 'main' panicked at 'slice index starts at 22 but ends at 0', libcore/slice/mod.rs:2340:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
[1] 43069 abort ncmc
可以为文件添加几个扩展字段,这样就不会丢掉网易云的这些信息了。
扩展字段 | 解析字段 | 可能值,可为空 |
---|---|---|
NETEASE_MUSICID | musicId | 150520 |
NETEASE_MOVIEID | mvId | 5307394 |
NETEASE_ALBUMID | albumId | 15189 |
NETEASE_ALBUMPIC_URL | albumPic | http://p4.music.126.net/4uHOznBK63ZOa9vft8qjxQ==/109951164124485287.jpg |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.