Python - Get id3 from MP3 File


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. def getID3(filename):
  2. fp = open(filename, 'r')
  3. fp.seek(-128, 2)
  4.  
  5. fp.read(3) # TAG iniziale
  6. title = fp.read(30)
  7. artist = fp.read(30)
  8. album = fp.read(30)
  9. anno = fp.read(4)
  10. comment = fp.read(28)
  11.  
  12. fp.close()
  13.  
  14. return {'title':title, 'artist':artist, 'album':album, 'anno':anno}

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.