import sys
args = sys.argv[1:]
-import eyeD3
-from eyeD3.tag import Mp3AudioFile
+import eyed3
+from eyed3.mp3 import Mp3AudioFile
def id3tag_recode(value):
if not id3tag:
sys.exit()
- 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
- images = id3tag.getImages()
+ images = id3tag.images
if images:
for image in images:
image.writeFile()
import sys
from getopt import getopt, GetoptError
-import eyeD3
-from eyeD3.tag import Mp3AudioFile
+import eyed3
+from eyed3.mp3 import Mp3AudioFile
def usage(msg):
if not id3tag:
sys.exit()
- 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
print '-----'
- printFrame("id3tag version", id3tag.getVersionStr())
- printFrame("Artist", id3tag_recode(id3tag.getArtist()))
- printFrame("Album", id3tag_recode(id3tag.getAlbum()))
- printFrame("Title", id3tag_recode(id3tag.getTitle()))
- dates = id3tag.getDate()
+ printFrame("id3tag version", id3tag.versionStr)
+ printFrame("Artist", id3tag_recode(id3tag.artist))
+ printFrame("Album", id3tag_recode(id3tag.album))
+ printFrame("Title", id3tag_recode(id3tag.title))
+ dates = id3tag.date
if dates:
printFramesList("Date", [date.getDate() for date in dates])
try:
- printFrame("Genre", id3tag.getGenre().getName())
+ printFrame("Genre", id3tag.genre.getName())
except: # Unknown id3tag or no id3tag at all
pass
- printTrack("Track num", id3tag.getTrackNum())
- printFramesList("Disc num", [str(n) for n in id3tag.getDiscNum() if n])
- printFramesList("Comments", [id3tag_recode(frame.comment) for frame in id3tag.getComments() if frame])
- printFramesList("Lyrics", [frame.description for frame in id3tag.getLyrics()])
- if id3tag.getImages():
+ printTrack("Track num", id3tag.trackNum)
+ printFramesList("Disc num", [str(n) for n in id3tag.discNum if n])
+ printFramesList("Comments", [id3tag_recode(frame.comment) for frame in id3tag.comments if frame])
+ printFramesList("Lyrics", [frame.description for frame in id3tag.lyrics])
+ if id3tag.images:
print "Has images"
- printFramesList("URLs", [frame.url for frame in id3tag.getURLs()])
+ printFramesList("URLs", [frame.url for frame in id3tag.uRLs])
import sys
from os import utime
from os.path import getmtime
-import eyeD3
+import eyed3
for filename in sys.argv[1:]:
mtime = getmtime(filename)
- id3tag = eyeD3.Tag()
- id3tag.link(filename, eyeD3.ID3_V1)
+ id3tag = eyed3.id3.tag.Tag()
+ id3tag.parse(filename, eyed3.id3.ID3_V1)
- id3tag.setVersion(eyeD3.ID3_V2)
+ id3tag.setVersion(eyed3.id3.ID3_V2)
id3tag.update()
utime(filename, (mtime, mtime))
import sys
from os import utime
from os.path import getmtime
-import eyeD3
+import eyed3
for filename in sys.argv[1:]:
mtime = getmtime(filename)
- id3tag = eyeD3.Tag()
- id3tag.link(filename, eyeD3.ID3_V2)
+ id3tag = eyed3.id3.tag.Tag()
+ id3tag.parse(filename, eyed3.id3.ID3_V2)
- id3tag.setVersion(eyeD3.ID3_V1)
+ id3tag.setVersion(eyed3.id3.ID3_V1)
id3tag.update()
utime(filename, (mtime, mtime))
#! /usr/bin/env python
import sys
-import eyeD3
-from eyeD3.frames import id3EncodingToString
+import eyed3
+from eyed3.id3.frames import id3EncodingToString
import locale
locale.setlocale(locale.LC_ALL, '')
for file in sys.argv[1:]:
print "File:", file
- tag = eyeD3.Tag()
- tag.link(file)
+ tag = eyed3.id3.Tag()
+ tag.parse(file)
for frame in tag.frames:
print str(frame)
if hasattr(frame, "text"):
#! /usr/bin/env python
import sys
-import eyeD3
-from eyeD3.frames import UTF_8_ENCODING
+import eyed3
+from eyed3.id3.frames import UTF_8_ENCODING
from os import utime
from os.path import getmtime, splitext, basename
name = splitext(basename(filename))[0]
mtime = getmtime(filename)
- id3tag = eyeD3.Tag()
- id3tag.link(filename)
+ id3tag = eyed3.id3.tag.Tag()
+ id3tag.parse(filename)
match = mp3_file.match(name)
if match:
name = match.group(2)
- id3tag.setVersion(eyeD3.ID3_V2)
+ id3tag.setVersion(eyed3.id3.ID3_V2)
id3tag.setTextEncoding(UTF_8_ENCODING)
id3tag.setTitle(name)
- print id3tag.getTitle()
+ print id3tag.title
id3tag.update()
utime(filename, (mtime, mtime))
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
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:
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
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))
from os.path import getmtime
mtime = getmtime(filename)
-import eyeD3
+import eyed3
versions = []
if not write_id3v2:
- versions.append(eyeD3.ID3_V2)
+ versions.append(eyed3.id3.ID3_V2)
if not write_id3v1:
- versions.append(eyeD3.ID3_V1)
+ versions.append(eyed3.id3.ID3_V1)
for version in versions:
- id3tag = eyeD3.Tag()
- id3tag.link(filename, version)
+ id3tag = eyed3.id3.tag.Tag()
+ id3tag.parse(filename, version)
id3tag.setVersion(version)
id3tag.remove()
from os.path import getmtime
mtime = getmtime(filename)
-import eyeD3
+import eyed3
versions = []
if write_id3v2:
- versions.append(eyeD3.ID3_V2)
+ versions.append(eyed3.id3.ID3_V2)
if write_id3v1:
- versions.append(eyeD3.ID3_V1)
+ versions.append(eyed3.id3.ID3_V1)
for version in versions:
- id3tag = eyeD3.Tag()
- id3tag.link(filename, version)
+ id3tag = eyed3.id3.tag.Tag()
+ id3tag.parse(filename, version)
id3tag.setVersion(version)
if album: id3tag.setAlbum(unicode(album, "latin1"))
#! /usr/bin/env python
import sys, os
-import eyeD3
-from eyeD3.frames import TITLE_FID, id3EncodingToString
+import eyed3
+from eyed3.id3.frames import TITLE_FID, id3EncodingToString
from m_lib.defenc import default_encoding
def id3tag_recode(value):
files = sys.argv[1:]
for i, filename in enumerate(files):
- id3tag = eyeD3.Tag()
- id3tag.link(filename)
- title = id3tag_recode(id3tag.getTitle())
+ id3tag = eyed3.id3.tag.Tag()
+ id3tag.parse(filename)
+ title = id3tag_recode(id3tag.title)
os.rename(filename, '%d - %s.mp3' % (i+1, title))
#! /usr/bin/env python
import sys
-import eyeD3
-from eyeD3.frames import TITLE_FID, id3EncodingToString
+import eyed3
+from eyed3.id3.frames import TITLE_FID, id3EncodingToString
from os import utime
from os.path import getmtime
for filename in sys.argv[1:]:
mtime = getmtime(filename)
- id3tag = eyeD3.Tag()
- id3tag.link(filename)
+ id3tag = eyed3.id3.tag.Tag()
+ id3tag.parse(filename)
title_frames = id3tag.frames[TITLE_FID]
if title_frames:
else:
print filename
- id3tag.setVersion(eyeD3.ID3_V2)
+ id3tag.setVersion(eyed3.id3.ID3_V2)
id3tag.update()
utime(filename, (mtime, mtime))