How to get the length of a mp3 link in python?
Question: I need get a mp3 lenght(from a url) to transform the lenght in seconds for a
delay, someone know how to do it?


Answer: Here is an example of retrieving the resource (mp3 file), and printing the
track length via [mutagen](https://code.google.com/p/mutagen/) library:

    
    
    from urllib import urlretrieve
    
    from mutagen.mp3 import MP3
    
    
    url = 'http://example.com/foo.mp3'
    filename, headers = urlretrieve(url)
    
    audio = MP3(filename)
    print audio.info.length
    

