Skip to content

Instantly share code, notes, and snippets.

@alwalker
Created July 10, 2012 12:46
Show Gist options
  • Save alwalker/3083046 to your computer and use it in GitHub Desktop.
Save alwalker/3083046 to your computer and use it in GitHub Desktop.
mp3 tagger
import os
import eyeD3
trackNo = 1
listing = os.listdir(".")
for infile in listing:
maxt = listing.count
title = " ".join(" ".join(str(infile).split(' ')[1:]).split('.')[:-1])
print title
tag = eyeD3.Tag()
tag.link(infile)
tag.header.setVersion(eyeD3.ID3_V2_3)
tag.setArtist("Total War")
tag.setGenre(24)
tag.setAlbum("Total War Eras")
tag.setTrackNum((trackNo, maxt))
trackNo = trackNo + 1
tag.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment