Skip to content

Instantly share code, notes, and snippets.

@Pusungwi
Created August 15, 2017 06:54
Show Gist options
  • Save Pusungwi/af5c5f758f1aa812ddf103e6d3409624 to your computer and use it in GitHub Desktop.
Save Pusungwi/af5c5f758f1aa812ddf103e6d3409624 to your computer and use it in GitHub Desktop.
배철수의 고우영 삼국지 변환시 쓰인 스크립트
import re
import os
import eyed3
if __name__ == '__main__':
track_number = 1
outer_re = re.compile('\((.+)\)')
for filepath in os.listdir():
filename, file_extension = os.path.splitext(filepath)
if file_extension == '.mp3':
music_title = outer_re.search(filename).group(1)
tag_info = eyed3.load(filepath)
#print(tag_info)
tag_info.tag.artist = 'MBC'
tag_info.tag.album = '배철수의 만화열전 - 고우영 삼국지'
tag_info.tag.album_artist = 'MBC'
tag_info.tag.title = music_title
tag_info.tag.track_num = track_number
tag_info.tag.save()
track_number += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment