0

I have been working with eyed3 for a while now and I have been using it to extract the genre of the mp3 files this way

import eyed3
audiofile = eyed3.load(path)
print audiofile.tag.genre.name

Now I have a URL like this, www.example.com/abc.mp3.

This does not work and gives me

IOError: file not found: www.example.com/abc.mp3

My question being, does eyed3.load() not support remote url? is there any workaround for this or any other library that could be suggested.

Thanks in advance.

Anurag Ramdasan
  • 4,189
  • 4
  • 31
  • 53

1 Answers1

1

First check to see if you prepend http:// to it, if it'll work, otherwise,

As far as I know - you'd need to retrieve the file from the server, first, and then use that.

import urllib
filename, headers = urllib.urlretrieve('http://example.com/abc.mp3')
eyed3.load(filename)
Jon Clements
  • 138,671
  • 33
  • 247
  • 280