X-Git-Url: https://git.phdru.name/?p=audio-cdr-video.git;a=blobdiff_plain;f=audio%2Fmp3%2Frecode-id3.py;h=c03dc5aa6fa735ab99aa78db0c5183586dea9d72;hp=a0aebeeb4eb012a2eec8192174c9dbce8b9049a3;hb=276d923954a25e142b349c78bb5dae23f476d00e;hpb=6f4caff9b64f98abccf2873b6132da83e945a563 diff --git a/audio/mp3/recode-id3.py b/audio/mp3/recode-id3.py index a0aebee..c03dc5a 100755 --- a/audio/mp3/recode-id3.py +++ b/audio/mp3/recode-id3.py @@ -5,8 +5,8 @@ from os import utime from os.path import getmtime from getopt import getopt, GetoptError -import eyeD3 -from eyeD3.frames import id3EncodingToString, \ +import eyed3 +from eyed3.id3.frames import id3EncodingToString, \ LATIN1_ENCODING, UTF_16_ENCODING, UTF_16BE_ENCODING, UTF_8_ENCODING from m_lib.opstring import recode @@ -60,9 +60,9 @@ def id3tag_set(frame, attr, src_encoding, dst_encoding): for filename in args: mtime = getmtime(filename) - for version in eyeD3.ID3_V2, eyeD3.ID3_V1: - id3tag = eyeD3.Tag() - if not id3tag.link(filename, version): + for version in eyed3.id3.ID3_V2, eyed3.id3.ID3_V1: + id3tag = eyed3.id3.tag.Tag() + if not id3tag.parse(filename, version): continue if not src_encoding: @@ -74,7 +74,7 @@ for filename in args: elif hasattr(frame, "comment"): id3tag_set(frame, "comment", src_encoding, dst_encoding) - title_frame = id3tag.getTitle() + title_frame = id3tag.title if title_frame: try: print title_frame @@ -83,9 +83,9 @@ for filename in args: else: print filename - if id3tag.getVersion() == eyeD3.ID3_V2_2: - version = eyeD3.ID3_DEFAULT_VERSION + if id3tag.version == eyed3.id3.ID3_V2_2: + version = eyed3.id3.ID3_DEFAULT_VERSION else: - version = eyeD3.ID3_CURRENT_VERSION + version = eyed3.id3.ID3_CURRENT_VERSION id3tag.update(version=version) utime(filename, (mtime, mtime))