# -*- coding: utf-8 -*- import os import eyed3 #重命名 ''' for info in os.listdir(r'./'): name = info.replace("{有声听书吧www.Ysts8.com}","") name = info.replace("{有声下吧www.Ysx8.com}","") print(name) os.renames(os.path.join(r'./',info), os.path.join(r'./',name)) ''' # 批量修改MP3属性
for info in os.listdir(r'./'): if info[-2:] != "py": for mp3 in os.listdir(r'./%s' %(info)): if mp3[-3:] == "mp3": audiofile = eyed3.load("./%s/%s" %(info, mp3)) #artist 艺术家 #album 专辑 #title 标题 #track_num 音轨编号