]> git.phdru.name Git - audio-cdr-video.git/blob - audio/mp3/list-id3v2-frames.py
Fix(audio/mp3): Adapt code to newer version of `eyed3`
[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.id3.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.id3.Tag()
13    tag.parse(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