python脚本批量修改mp3文件具体属性

修改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)
	
    原文作者:dream161110
    原文地址: https://blog.csdn.net/dream161110/article/details/102340188
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞