I need to extract a cover art from a remote mp3 file and save it to a file without downloading the whole mp3. But I have no success with it. I have try to download the first 100 bytes of the file like:
import urllib2
from mutagen.mp3 import MP3
req = urllib2.Request('http://www.stephaniequinn.com/Music/Commercial%20DEMO%20-%2001.mp3')
req.headers['Range'] = 'bytes=%s-%s' % (0, 100)
response = urllib2.urlopen(req)
headers = response.info()
print headers.type
print headers.maintype
data = response.read()
print len(data)
I have read about that the id 3 Tags are at the last 128 bytes of a mp3. Now I need some help help to download only the last bytes that contains the apic cover art and extract the image.
thanks for helping me out