Search code examples
pythonaudio-playerechonest

Creating a track object with track_from_file method in pyechonest


I am new to python. I am trying to use track_from_file method in pyechonest to create a track object. This is the code I wrote:

from pyechonest import config
from pyechonest.track import track_from_file
config.ECHO_NEST_API_KEY = "KRZG4XOVUQRKI45DP"
f = open("ShayneWard-NoPromises.mp3")
t = track_from_file(f, 'mp3')

But this is not working. I got an EchoNestIOError. This is the full error Traceback that i got.

Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "build/bdist.linux-x86_64/egg/pyechonest/track.py", line 243, in track_from_file 
File "build/bdist.linux-x86_64/egg/pyechonest/track.py", line 331, in track_from_md5 
File "build/bdist.linux-x86_64/egg/pyechonest/track.py", line 209, in _profile 
File "build/bdist.linux-x86_64/egg/pyechonest/util.py", line 257, in callm pyechonest.util.
EchoNestIOError: Echo Nest Unknown Error

Can anyone tell me what have I done wrong?


Solution

  • I finally figured it out. It seems that the upload does not take place through the proxy server of my university network which uses NAT.