Giter Club home page Giter Club logo

Comments (12)

UnderCooled avatar UnderCooled commented on August 16, 2024 1

而且 musicId 不是纯数字的其实非常少见,这首也是我朋友转换失败发我的,他用的网易云客户端跟我的一样,大多数都是正常的数字。
再比如说这个元数据里的码率,感觉也是随便标一标。
所以元数据中这些没什么用的字段,就当作字符串”跳过“就行了,这样程序本身兼容度反而还好一些。

from ncmc.

magic-akari avatar magic-akari commented on August 16, 2024

To maintain compatibility, we need to support both numbers and strings types, as there are instances where the music_id parsed from the old ncm is of numeric type.

The music_id is not used, but there is a field of the same type in artist, so we need to use artist, and therefore we cannot skip the definition of MusicId.

I downloaded this song from both the macOS and Windows clients, and found that the musicId is simply a number or a string composed of numbers. Could you please inform me of the client you are using, or share your ncm file with me? This would facilitate my subsequent modifications and allow me to add it to the test.

P.S. If you don't need to write the meta back to the FLAC/MP3, you can add the --dump parameter.

from ncmc.

UnderCooled avatar UnderCooled commented on August 16, 2024

文件100M左右,放在国外网盘了,免注册直连的:
https://small.fileditchstuff.me/s10/kempHPQdwlWAygXNsIpQ.ncm

The music_id is not used, but there is a field of the same type in artist, so we need to use artist, and therefore we cannot skip the definition of MusicId.

我觉得艺术家那边那个 musicId 好像也没啥用啊,我试过多个艺术家合作的歌曲,也能在生成的 flac 得到正确的元数据。

而且你看我发的那个 JSON 片段,musicId 的那个数字,跟 artist 的数字也不一致,如果哪天网易再改一次 musicId 成 UUID 的形式,这 JSON 解析又得再改一次了。

P.S. If you don't need to write the meta back to the FLAC/MP3, you can add the --dump parameter.

用 ncmc 的主要原因就是您开发的这个工具是唯一现在能正确让 flac 显示封面的😊

from ncmc.

magic-akari avatar magic-akari commented on August 16, 2024

22692714.tgz

This is an example that uses the numeric type.

{"musicId":22692714,"musicName":"ムーンライト伝説 -short ver.-","artist":[["中川翔子",17308]],"albumId":2082037,"album":"しょこたん☆かばー 3 〜アニソンは人類をつなぐ〜","albumPicDocId":"109951167807437880","albumPic":"https://p3.music.126.net/z1iibJvrTT3Ucihm1P2n4w==/109951167807437880.jpg","bitrate":320000,"mp3DocId":"c8d4f352d5b2b314880a917039230d2a","duration":86000,"mvId":0,"alias":[],"transNames":[],"format":"mp3"}

Although the second parameter of the artist tuple is not used, it cannot be skipped during deserialization.
If its structure becomes more complex in the future, I will consider replacing it directly with json::Value, but not now.

from ncmc.

UnderCooled avatar UnderCooled commented on August 16, 2024

Although the second parameter of the artist tuple is not used, it cannot be skipped during deserialization.

artist 的 tuple 里都是 string ,不影响反序列化啊。

vorbis_comment
                    .set_artist(music_meta.artist.into_iter().map(|ar| ar.0).collect::<Vec<_>>());

这里不是只取了 0 位置的 string 吗?后面也就丢弃了。

我按前面这样改完编译也没报错,执行也正常。

from ncmc.

magic-akari avatar magic-akari commented on August 16, 2024

Hello @UnderCooled ,
I'm developing unit tests to cover more scenarios and require additional examples similar to these. Could you provide me with the client and version number you're using? This will help me gather more examples independently.

from ncmc.

UnderCooled avatar UnderCooled commented on August 16, 2024

It was "3.0.0.Beta(64位)(Build:202739)Patch: 2d493c1".
It is "3.0.0.Beta(64位)(Build:202825)Patch: dcedbae".
OS: Windows 11

from ncmc.

magic-akari avatar magic-akari commented on August 16, 2024

Just realized that the bitrate of this song is 3999000, did you use the option "超清母带" for downloading?
Could you help me by checking and exporting their JSON using ncmc dump mode to see if the issue is unique to "超清母带" only?

Because I cannot put such a huge file into the code repository, if possible, please help me download the songs in this playlist using the same download options, thank you.
I just get a Windows machine to download them.

from ncmc.

UnderCooled avatar UnderCooled commented on August 16, 2024

不是SVIP,所以也不是超清母带的,我很怀疑元数据里那个码率是不是以前网易云乱写的,当年网易云”无损“文件也都故意做到很大。

from ncmc.

UnderCooled avatar UnderCooled commented on August 16, 2024

比方我这个 Ashokan Farewell 这么老的曲子,看元数据的话也会看到码率出现这种 3999000 的:

// Bronn Journey - Ashokan Farewell.ncm
{"musicId":"27552475","musicName":"Ashokan Farewell","artist":[["Bronn Journey","813183"]],"albumId":"2635049","album":"Journey Home","albumPicDocId":"109951166964728488","albumPic":"http://p3.music.126.net/fTGLR7OCjVvxrTKKcwk8Ng==/109951166964728488.jpg","bitrate":3999000,"mp3DocId":"30401e7e0589efab2d6070fcecb79e00","duration":250866,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-6.2311,"privilege":{"flag":1277957}}
// Buddy Greene - Ashokan Farewell.ncm
{"musicId":"1381969851","musicName":"Ashokan Farewell","artist":[["Buddy Greene","249874"]],"albumId":"80773072","album":"Harmonica Anthology","albumPicDocId":"109951164263506494","albumPic":"http://p4.music.126.net/Tf3eDYrxoByOvSNgF9sxGA==/109951164263506494.jpg","bitrate":3999000,"mp3DocId":"b3b2f768ecd88daf2aafcdb320da759d","duration":172564,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-4.4058,"privilege":{"flag":1540101}}
// International String Trio - Ashokan Farewell.ncm
{"musicId":"1450422584","musicName":"Ashokan Farewell","artist":[["International String Trio","35227577"]],"albumId":"89866783","album":"Appalachia","albumPicDocId":"109951165011613124","albumPic":"http://p3.music.126.net/iEuhYsdrvkpj1FmlII8Lnw==/109951165011613124.jpg","bitrate":999000,"mp3DocId":"20a522063468177a844c78a2ba92f1f1","duration":201280,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-4.1216,"privilege":{"flag":1081349}}
// Justin King - Ashokan Farewell.ncm
{"musicId":"18496175","musicName":"Ashokan Farewell","artist":[["Justin King","36728"]],"albumId":"1697704","album":"Le Bleu","albumPicDocId":"109951165107537399","albumPic":"http://p4.music.126.net/3PYzA5dW3c-GHmJ9Oo4VBg==/109951165107537399.jpg","bitrate":999000,"mp3DocId":"03fc629289c7c57e20b750d5d05db520","duration":85053,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-4.0303,"privilege":{"flag":1081349}}
// Kort & Beth McCumber - Ashokan Farewell.ncm
{"musicId":"1467333409","musicName":"Ashokan Farewell","artist":[["Kort & Beth McCumber","36226053"]],"albumId":"93293873","album":"Greetings From McCumberland Gap","albumPicDocId":"109951165189746171","albumPic":"http://p3.music.126.net/27Kvjf_-YcRlkwyepLScoA==/109951165189746171.jpg","bitrate":3999000,"mp3DocId":"d7b19ac43453fd71ab528e64bff552ca","duration":177640,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-3.7275,"privilege":{"flag":1277957}}
// Music Lab Collective,Valentina Lisitsa - Ashokan Farewell.ncm
{"musicId":"1859865982","musicName":"Ashokan Farewell","artist":[["Music Lab Collective","1156013"],["Valentina Lisitsa","66284"]],"albumId":"130141087","album":"Classical Relax","albumPicDocId":"109951166161957704","albumPic":"http://p4.music.126.net/rD-VzCOrYPGYghsDf_boLw==/109951166161957704.jpg","bitrate":3999000,"mp3DocId":"190e00802b584284df02f4d56a78a596","duration":292946,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-2.2547,"privilege":{"flag":1294596}}
// Nashville Chamber Orchestra,Paul Gambill - Ashokan Farewell.ncm
{"musicId":"25234301","musicName":"Ashokan Farewell","artist":[["Nashville Chamber Orchestra","12263313"],["Paul Gambill","283242"]],"albumId":"2222285","album":"100 Best Relaxing Classics","albumPicDocId":"6625657069970141","albumPic":"http://p4.music.126.net/pz6Bziyr_jnIv6IvcS6lsQ==/6625657069970141.jpg","bitrate":3999000,"mp3DocId":"853bc59c4a63c456e2d77f848a22def4","duration":310891,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":0.2027,"privilege":{"flag":1278212}}
// Piano Lads - Ashokan Farewell.ncm
{"musicId":"561723975","musicName":"Ashokan Farewell","artist":[["Piano Lads","13098188"]],"albumId":"38849650","album":"Piano Songs: America the Beautiful","albumPicDocId":"109951166733305930","albumPic":"http://p4.music.126.net/BGZlZJnZjJB5MjFenxuqQQ==/109951166733305930.jpg","bitrate":999000,"mp3DocId":"eef5e32191f3068000a08e8762320f36","duration":197360,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":1.0053,"privilege":{"flag":1081349}}
// Shaan Ramaprasad - Ashokan Farewell.ncm
{"musicId":"1459613176","musicName":"Ashokan Farewell","artist":[["Shaan Ramaprasad","35787211"]],"albumId":"91820528","album":"Ashokan Farewell","albumPicDocId":"109951165104089525","albumPic":"http://p3.music.126.net/U_22kzQhyEwHt8bhLQ-TTQ==/109951165104089525.jpg","bitrate":3999000,"mp3DocId":"7a15a71667e1ea271b398ec505a63e10","duration":179200,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-2.4169,"privilege":{"flag":1278213}}
// The O'Neill Brothers - Ashokan Farewell.ncm
{"musicId":"19287248","musicName":"Ashokan Farewell","artist":[["The O'Neill Brothers","45354"]],"albumId":"1769880","album":"Harvest","albumPicDocId":"109951166890147357","albumPic":"http://p3.music.126.net/xUjerDGJTOBDzjO30gDjCg==/109951166890147357.jpg","bitrate":3999000,"mp3DocId":"c0bca78f2f19a67d3bd8941a2dd2255e","duration":265306,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":-5.6104,"privilege":{"flag":1278212}}
// The United States Army Strings - Ashokan Farewell.ncm
{"musicId":"464712943","musicName":"Ashokan Farewell","artist":[["The United States Army Strings","12545159"]],"albumId":"35265342","album":"UNITED STATES ARMY STRINGS: United States Army Strings","albumPicDocId":"18172728184694410","albumPic":"http://p4.music.126.net/VZ_ZVLqSDmNgauyVxuEUKA==/18172728184694410.jpg","bitrate":999000,"mp3DocId":"066f0eeb7f10f70d017c0cf11693272f","duration":249653,"mvId":"","alias":[],"transNames":[],"format":"flac","fee":8,"volumeDelta":0,"privilege":{"flag":1081348}}

from ncmc.

UnderCooled avatar UnderCooled commented on August 16, 2024

image

左边是 ffprobe 的结果,右边是 dump 元数据 JSON 里写的。

from ncmc.

UnderCooled avatar UnderCooled commented on August 16, 2024

我刚才试了下,感觉英文歌日文歌,应该都不会有这种非数字的情况,无论新歌老歌。中文歌有的太老直接就给flac下载了,能得到 NCM 格式的,我也没找出来……

from ncmc.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.