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
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 took the liberties (and probably violated your TOS in the process) of hacking away at song-parser.js which I found in ~/.config/chromium/Default/Extensions/ehohhddamheegbbkabfgegbaeminghlb/1.4.9_0/js
After injecting my 600-line library on the top of the file, I made songParser.Parse.anchor magically asynchronized, and dependent on my block of code (I don't get most of it, so it's probably done wrong).
Anyway, I restarted chromium, went to chrome://extensions/ and inspected background.html, went to the storage tab and did DROP TABLE Songs and DROP TABLE Sites until the table was empty.
And then it worked :) Cover art, title, artist and album.
My library: http://github.com/antimatter15/js-id3v2
Hacked song-parser.js: http://gist.github.com/470285
What needs to be done: Supporting ID3v1, which could be done by mixing it with the nihilogic one. There are also a few remaining bugs with the hack, like the exfm icon doesn't show the right number, etc. I would love to see this inside the next version of Extension.FM.
antimatter15@gmail.com
antimatter15
I made a few changes so it can parse a few more songs.
http://gist.github.com/470285
antimatter15
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.
antimatter15
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.
antimatter15
It just grabs the first few bytes.
Dan Kantor
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?
antimatter15
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/
Charles Smith
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