]> git.phdru.name Git - audio-cdr-video.git/blob - audio/mp3/list-id3v2-frames.py
Initail import
[audio-cdr-video.git] / audio / mp3 / list-id3v2-frames.py
1 #! /usr/bin/env python
2
3 import sys
4 import eyeD3
5 from eyeD3.frames import id3EncodingToString
6
7 import locale
8 locale.setlocale(locale.LC_ALL, '')
9
10 for file in sys.argv[1:]:
11    print "File:", file
12    tag = eyeD3.Tag()
13    tag.link(file)
14    for frame in tag.frames:
15       print str(frame)
16       if hasattr(frame, "text"):
17          text = frame.text
18       elif hasattr(frame, "comment"):
19          text = frame.comment
20       else:
21          text = ''
22       print text.encode(id3EncodingToString(frame.encoding))
23    print