Posted By

zhyar on 10/01/12


Tagged

python mp3 id3tag


Versions (?)

Simple ID3 tagger


 / Published in: Python
 

Require the ID3 lib. Place the script in the directory containing the mp3 files.

  1. import os, sys
  2. from ID3 import *
  3.  
  4. files = os.listdir(os.getcwd())
  5.  
  6. for f in files:
  7. x = os.path.splitext(f)
  8. if x[1] == '.mp3':
  9. n = x[0].split(' - ')
  10. author = n[0]
  11. title = n[1]
  12. id3info = ID3(f)
  13. id3info['ARTIST'] = author
  14. id3info['TITLE'] = title
  15. print f+' id3 tagged.'
  16. print 'Done!'

Report this snippet  

You need to login to post a comment.