43081j / id3

A JavaScript ID3 tags parser for Node & browsers.
MIT License
335 stars 63 forks source link

Uncaught URIError: URI malformed #22

Closed Pixeladed closed 6 years ago

Pixeladed commented 9 years ago

With some files it return this error to the console

Here's one of the file that got the error: http://www.mediafire.com/listen/13evge2b3nw5l1o/Muzzy_Insignia.mp3

camikazegreen commented 9 years ago

I am having the same issue with an album "Putumayo Presents Acoustic Café" It is caused by the special character é, and if replaced with a regular e it works fine.

I'm using the minified library, but it is breaking on this line where 'n' is the album title:

if (a) {
            return new Buffer(n).toString()
        } else {
            return decodeURIComponent(escape(n))
        }

The escape is encoding the é as %E9 (Unicode) and the decodeURIComponent only works on UTF-8 characters.

cqr commented 8 years ago

I saw this with an MP3 that had an image encoded in it, specifically http://traffic.libsyn.com/thefeed/003_thefeed.mp3

What is the purpose of this roundtrip?

gbiryukov commented 8 years ago

You can use this fork https://github.com/gbiryukov/id3 This error fixed To use as bower dependency, add to you bower.json dependencies: "id3": "https://github.com/gbiryukov/id3.git#1.1.4"

vellaggio commented 8 years ago

Hey, I've fixed this problem by replacing escape function for encodeURIComponent.

So instead of decodeURIComponent(escape(n)) --> decodeURIComponent(encodeURIComponent(n))