Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@utgwkk
Created February 10, 2018 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utgwkk/2eef992513c6287214a4097ba8e32990 to your computer and use it in GitHub Desktop.
Save utgwkk/2eef992513c6287214a4097ba8e32990 to your computer and use it in GitHub Desktop.
カレントディレクトリのMP3のファイル名を,ID3をもとに変更するスクリプト
"""
You have to `pip install mutagen` before executing this script
"""
import os
from glob import glob
from mutagen.easyid3 import EasyID3
for idx, path in enumerate(glob('*.mp3')):
tags = EasyID3(path)
new_path = '%02d - %s.mp3' % (idx + 1, tags['title'][0])
os.rename(path, new_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment