updated on Sat Jan 21 20:03:50 UTC 2012
[aur-mirror.git] / sego3 / readid3
blob84aff936b305906bf1e1022b2d48d4892fe17509
1 #! /usr/bin/env python2
3 import eyeD3
4 import sys
5 import locale
7 ENCODING = locale.getpreferredencoding();
8 filename = sys.argv[1]
9 parameter = sys.argv[2]
10 tag = eyeD3.Tag()
11 tag.link(filename)
13 if parameter == "art": 
14         print tag.getArtist().encode(ENCODING, "replace")
15 elif parameter == "alb": 
16         print tag.getAlbum().encode(ENCODING, "replace")
17 elif parameter == "tit": 
18         print tag.getTitle().encode(ENCODING, "replace")
19 elif parameter == "gen": 
20         print tag.getGenre()
21 elif parameter == "yea": 
22         print tag.getYear()
23 elif parameter == "tra": 
24         print tag.getTrackNum()