-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tag::read_from_path()
: value: Parsing: uneven number of IPLS strings
#147
Comments
I forced a specific version in |
It seems the id3 package has introduced a regression, causing a reading error on some mp3 files. See polyfloyd/rust-id3#147
@Holzhaus Would you be able to look into this? |
Also, don't mind my comment about not understanding how I could have introduced a regression. I forgot that cargo by default bumps minor versions on rebuild, and I have recently reinstalled my tools, so this makes sense. I was genuinely confused for a second :) |
I can have a look, but according to the spec the IPLS tag is supposed to consist of involvee-involement tuples:
If there is an uneven number of IPLS items, then this does not hold. We coud either assume an empty last item, or maybe parse the entire IPLS as "Unknown" content in that case? |
I'm also encountering this, apparently out of the ~7000 mp3 files I have, now only 137 get parsed correctly, all the rest fail with the aforementioned error. They all parse successfully with 1.14. |
Can you look into failing files? Could you post the tag contents for that frame here? Maybe there is some quirk with popular tagging software that writes the tag slightly incorrectly? Then we could add a workaround instead of encoding the entire tag as unknown. |
In case it was overlooked, I've attached a sample failing file in the original post. |
I looked at some of the failing files, and it seems they don't have the IPLS tag filled out. I looked at it with MusicBrainz Picard, is there a better software to use? The files were originally tagged with a bunch of different tagging software not (just) Picard. |
IPLS is for ID3v2.3. If it's an ID3v2.4 tag, check the TMCL and TIPL frames. |
Those are also missing, or at least don't show up, but I wonder whether Picard actually supports these. If I try to add a new tag, I can't see anything resembling "involved people list" or "credits list" (which seem to correspond to TMCL and TIPL) in the list of tags that can be added. |
Okay, I looked into the sample file that OP attached to the ticket: $ cargo run --example tagdump sample.mp3 | hexdump -C | less
000000f0 00 03 52 75 73 68 4a 65 74 31 54 49 50 4c 00 00 |..RushJet1TIPL..|
00000100 00 09 00 00 03 61 72 72 61 6e 67 65 72 54 44 4f |.....arrangerTDO|
00000110 52 00 00 00 0b 00 00 03 32 30 31 34 2d 31 32 2d |R.......2014-12-| As you can see, the I can think of 3 ways to handle frames that fail to parse:
I have no strong preference, but both would be an API change. @polyfloyd What do you think? |
For the record, all my files were tagged using the beets music library manager. It seems to be using the Mutagen library for doing the tagging. If you're sure this is an error on their behalf, we should open a ticket. I haven't looked closely into how the TIPL tag works, but in my experience, ID3 can be a terribly vague standard when you zoom in on its details, so perhaps this is one of those cases of "we interpreted the spec differently", or "we know this is slightly misaligned with the spec, but historically this is how most tools have behaved and we need to conform to the majority". |
At least some time ago, beets didn't support the
I fully agree that the spec is vague. But in this specific case, it is pretty clear that the field should contain value pairs:
In the sample file, the frame contains only the string |
I used the same command you provided to check some of my files, and they look like the sample OP provided:
Also, I saw randoragon mention beets, I actually use that as well, but I completely forgot that it re-tags the files, I mostly use it to sort files into a neat directory structure. Sorry should have mentioned that. That gives more pointers that the problem might be in beets/mutagen. |
Regarding graceful handling, it looks like mutagen just assumes an empty value at the end: $ python -m venv myvenv
$ . myvenv/bin/activate
(myvenv) $ pip install mutagen
Collecting mutagen
Downloading mutagen-1.47.0-py3-none-any.whl.metadata (1.7 kB)
Downloading mutagen-1.47.0-py3-none-any.whl (194 kB)
Installing collected packages: mutagen
Successfully installed mutagen-1.47.0
(myvenv) $ python -c 'import sys; import mutagen; f = mutagen.File(sys.argv[1]); print(sys.argv[1], f["TIPL"])' sample.mp3
sample.mp3 TIPL(encoding=<Encoding.UTF8: 3>, people=[['arranger', '']]) Maybe we can also consider doing this? It doesn't really make sense to have an empty name for the "arranger" role, but if stops making parsing fail this might also be a feasible option. Advantage would be that it doesn't require an API change. |
The test data from extracted from the sample file attached to polyfloyd#147. $ cargo run --example tagdump sample.mp3 > testdata/github-issue-147.id3 Tag size: 42998 Footer: no Writing 42998 bytes to stdout... Done.
Here's a patched version that mirrors how mutagen handles it: #154 |
The test data from extracted from the sample file attached to #147. $ cargo run --example tagdump sample.mp3 > testdata/github-issue-147.id3 Tag size: 42998 Footer: no Writing 42998 bytes to stdout... Done.
Merged the proposed fix. Thank you all for your involvement :) |
Just ran a test with the new 1.16.2 release, all my files parse again, thank you very much! |
Recently, id3 completely stopped being able to parse any of my files. Strangely enough, I have not run
cargo update
in a long time, so I don't understand how I could have even introduced a regression, but nevertheless, here's a reproducible example.sample.mp3.tar.gz
I attached
sample.mp3
as a gzipped tar archive, because GitHub does not seem to support attaching MP3s directly (but MP4s are totally fine, huh .-.). I tested many of my over 10,000 local mp3 files and all of them exhibit the same error. It did not use to happen before, and other tools likemid3v2
andeyeD3
have no trouble reading the same files.Executing the above program with
sample.mp3
in the current directory produces the following, withRUST_BACKTRACE=full
:If there's something wrong with my files, I would appreciate some feedback. Although, again, other tools seem to have no trouble reading them, and neither did rust-id3 just a few weeks ago, so this seems strange.
The text was updated successfully, but these errors were encountered: