修改mp3文件属性
# -*- coding: utf-8 -*-
import os
import eyed3
path = os.getcwd()
files= os.listdir(path)
for file in files:
tp = file[-3:]
#print(tp)
if tp != "mp3":
continue
filename = file[:-4]
print(filename)
os.rename(file, "tst.mp3")
#audio = eyed3.load(path+"\\"+file)
audio = eyed3.load("tst.mp3")
audio.tag.title = filename
audio.tag.artist = u"徐涛"
audio.tag.album = u"2020考研政治强化班"
audio.tag.save()
os.rename("tst.mp3", file)