powered by UserVoice

Product Ideas Forum

6 votes

ID3v2 Data Patch

ExtensionFM is pretty awesome, but it couldn't recognize any of the artists/albums/titles of any of my songs.

I wrote an ID3v2 parser in Javascript (because i can xD) today (wasn't too hard, and as far as I know, nobody has done it before), after noticing that ExFM didn't support it :(

So I to... more

  1. Comments
  1. 3

    I made a few changes so it can parse a few more songs.

    http://gist.github.com/470285

  2. 3

    Also as a note, you should probably move the code from song-parser to something in background.html so it can do songs which are stored on different domains, which does seem to be a common case.

    Also, it looks like your manifest.json doesn't support https:// sites.

  3. 3

    However if you were to support ID3v1, which has the metadata stored at the very end rather than the beginning (with ID3v2, which mine uses, I think ID3v2 is more common, so yay :)), you would need to download the entire file (as JS doesn't support a seek-like operation on http).

    My song-parser.js downloads the entire ID3 metadata block and once it ends, the request gets aborted.

  4. 3

    It just grabs the first few bytes.

  5. Admin

    This is really great. I'm curious - is your modified songparser.js file now downloading the mp3 file to get the id3 data? If so, does it grab the whole file or just a few bytes?

  6. 3

    I haven't had any problems with it, all the songs seem to load properly. One one or two songs weird unicode characters get added for no reason. I just found this other library which supports both ID3v1 and ID3v2, and probably better than mine. http://github.com/aadsm/JavaScript-ID3-Reader/tree/master/src/

  7. Admin

    Wow- great stuff. We'll take a look and see how it might work inside the extension for a wider group- is it still working well for you?
    Best,
    Charles

powered by UserVoice