1

I have been creating an MP3 tag editor with Python 3.7 and Mutagen on a Windows 10 PC. I would like to write to the URL frame WFED but it does not respond. I have been able to successfully update another URL frame, WXXX using the code below.

The code below works for WXXX

new_url = unicode("http://url.com").encode('raw_unicode_escape').decode("utf-8") 
tags.add(WXXX(encoding=0, url=new_url))

The code below does not work on WFED

new_feed = unicode("http://url.com").encode('raw_unicode_escape').decode("utf-8")
tags.add(WFED(encoding=0, url=new_feed))

Can anyone provide any guidance on how I can write to WFED?

Neil Ball
  • 11
  • 3
  • I haven't used Mutagen for a while, but I think your problem is that, because WFED is not a standard frame, Mutagen doesn't know what format it is, and therefore assumes it's a text field, not a url field. – abarnert Jul 19 '18 at 21:49
  • If I'm right, you can monkeypatch mutagen's dict of frames to tell it about WFED. Which may sound hacky, but the only clean solution is to build a url-link frame in raw bytes. – abarnert Jul 19 '18 at 22:08

2 Answers2

1

As others have mentioned, WFED is not a standard ID3v2.x frame

See ID3.org:

Since you are adding a URL, you are better off sticking with WXXX, which ID3 defines as "User defined URL link frame".

Or, alternatively, you can use WOAF, WOAR, WOAS, or WORS frames to store the URL.

howdoicode
  • 779
  • 8
  • 16
0

Not only is WFED not a standard frame, but it doesn't even seem to have the standard format for a W... frame!

WXXX frames have an encoding field but W... frames do not. In ID3, URLs are always encoded in ISO-8859-1 and thus don't need an encoding field. The reason WXXX does have one is for its description field.

But with WFED, which I believe is an undocumented Apple iTunes extension, every MP3 file I have with this frame begins with a NULL byte, followed by the URL in ASCII (or ISO-8859-1), which makes me think Apple made the WFED frame use a T... frame format rather than a W... frame format.

I haven't tested with other ID3 reading/writing tools or libraries, but Exiftool does report every WFED as being blank because it follows the actual standard.

So yes maybe the problem is that Mutagen doesn't support WFED or maybe it expects it to follow the W... standard format and your software the uses the frame expects it to be in the undocumented format. Check your file in a hex editor to see if Mutagen changes it.

hippietrail
  • 15,848
  • 18
  • 99
  • 158