Slashdot Mirror


Efficiently Reading ID3v2 Tags Over HTTP?

Paul Crowley asks: "Given an HTTP URL for an MP3 file, what's the best way to read its ID3 tags on a GNU/Linux system? It shouldn't be necessary to fetch the whole file: HTTP byteranges should make it possible to fetch only the tiny fraction that's needed, for a big saving in network bandwidth. However, existing ID3v2 libraries are designed to read local files. Extending these libraries for this purpose, or implementing a new one, would be a big job. What's the clean solution - is FUSE the best way, or is there a simpler way that doesn't require root privs? Can I do it using the existing id3lib binary?"

1 of 65 comments (clear)

  1. Re:HTTP 499 by pbox · · Score: 4, Insightful

    This is why

    1. read first 3 bytes with http bytrange
    2. if id3, process tag from byte 0
    3. else read last 10 bytes
    4. if 3di, process tag from backwards
    5. else, see if there is a id3v1 tag at the end
    6. if yes, read last 10 bytes before id3v1
    7. if 3di, then process backwards

    So it is possible. He just needs to read the fricking id3 tag definitions.

    --
    Code poet, espresso fiend, starter upper.