taurusxin / ncmdump

转换网易云音乐 ncm 到 mp3 / flac. Convert Netease Cloud Music ncm files to mp3/flac files.
MIT License
1.04k stars 168 forks source link

[Bug] *For ncmdump-go* foobar2000 reports "Unsupported format or corrupted file" #32

Closed mooesy closed 3 days ago

mooesy commented 6 days ago

Bug 描述

This issue is for ncmdump-go. I posted it here since I couldn't register an account for the repo where it belongs.

foobar2000 reports "Unable to open item for playback (Unsupported format or corrupted file)" when importing NCM songs unlocked with this tool. When tested with foobar2000's integrity verification tool it shows the following:

Error: Corrupted FLAC stream Error: Unsupported format or corrupted file

复现方法

复现此 Bug 的方法

  1. unlock NCM songs with ncmdump-go
  2. import the songs into foobar2000
  3. 发生报错

预期行为 foobar2000 shouldn't be showing any errors.

屏幕截图

image

image

环境

附加内容

添加更多其他内容以帮助开发者更好地了解这个 Bug。

taurusxin commented 6 days ago

请提供源文件样本以供分析

mooesy commented 6 days ago

sample.zip

Integrity verification report included

taurusxin commented 6 days ago

Using Chrome, ffplay, and MPC players can open, decodate and play the file normally, please try different software.

taurusxin commented 6 days ago

It seems to be an issue with ncmdump-go. Please wait for me to locate and fix the bug.

XiGou commented 3 days ago

@taurusxin I am using ncmdump-go.

I found similar issue and there is a minimal python3 script to reproduce it:

/music/ncm_converted/VipSongsDownload/xxx.flac is the ncmdump-go converted audio file.

>>> from tinytag import TinyTag
>>> tag = TinyTag.get('/music/ncm_converted/VipSongsDownload/xxx.flac')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/tinytag/tinytag.py", line 196, in get
    tag.load(tags=tags, duration=duration, image=image)
  File "/usr/local/lib/python3.10/site-packages/tinytag/tinytag.py", line 1087, in load
    self._determine_duration(self._filehandler)
  File "/usr/local/lib/python3.10/site-packages/tinytag/tinytag.py", line 1132, in _determine_duration
    oggtag._parse_vorbis_comment(fh)
  File "/usr/local/lib/python3.10/site-packages/tinytag/tinytag.py", line 938, in _parse_vorbis_comment
    elements = struct.unpack('I', fh.read(4))[0]
struct.error: unpack requires a buffer of 4 bytes
taurusxin commented 3 days ago

This is caused by the metadata lib go-flac, I'm currently woking on it and contacting with the author of it.

taurusxin commented 3 days ago

It seems that NetEase Cloud Music 3.0.5 has started to embed metadata with album cover images in music files again. Maybe you can try using the C++ version. I tested several files and did not encounter the problem of missing cover images.

taurusxin commented 3 days ago

Fixed

See Release 1.7.0: https://git.taurusxin.com/taurusxin/ncmdump-go/releases/tag/1.7.0