Quantcast
Channel: Blogfreakz - Web Design and Web Development resources » Python
Viewing all articles
Browse latest Browse all 7

Tagging ID3 Metadata With Python

$
0
0

Here’s a nice and short Python script that some of you might find quite handy, especially if you have a huge collection of music files (MP3s): an ID3 metadata tagger. To use, all it requires is the ID3 lib and for the script to be placed in the same directory together with the MP3 files.

ScreenHunter 532 Oct. 05 10.26 Tagging ID3 Metadata With Python

import os, sys
from ID3 import *

files = os.listdir(os.getcwd())

for f in files:
 x = os.path.splitext(f)
 if x[1] == '.mp3':
 n = x[0].split(' - ')
 author = n[0]
 title = n[1]
 id3info = ID3(f)
 id3info['ARTIST'] = author
 id3info['TITLE'] = title
 print f+' id3 tagged.'
print 'Done!'

Incoming search terms for the article:


Viewing all articles
Browse latest Browse all 7

Trending Articles