我有很多以以下格式命名的 mp3 文件:“艺术家 - 歌曲” 艺术家和歌曲都在文件的“标题”字段中。我想改变他们,让他们在各自的领域拥有艺术家和歌曲。
为此,我使用了 eyed3 python 模块。但是,当我运行我的代码时,我收到一条错误消息:“Lame tag CRC check failed”,并且没有更改任何文件属性。这是我目前拥有的代码:
import os
import eyed3
for files in os.listdir("C:/Users/justi/Desktop/New Music - Copy"):
artist_and_song = files.split(".") # Gets rid of ".mp3" suffix
split_at_dash = artist_and_song[0].split("-") # Separates artist and song
artist = split_at_dash[0]
song = split_at_dash[1]
# Loads each and every MP3
mp3 = eyed3.load("C:/Users/justi/Desktop/New Music" + '/' + files)
mp3.initTag()
mp3.tag.artist = artist
mp3.tag.title = song
mp3.tag.save()
我在 StackOverflow 的其他地方看到过这个问题,但没有一个建议的解决方案能奏效。任何帮助将不胜感激。