Skip to content

Instantly share code, notes, and snippets.

@koss822
Created August 26, 2022 18:29
Show Gist options
  • Save koss822/bc063c9c588f11a8ddd9898e5b2c3266 to your computer and use it in GitHub Desktop.
Save koss822/bc063c9c588f11a8ddd9898e5b2c3266 to your computer and use it in GitHub Desktop.
Add ID3 tag to MP3 in current directory
from pathlib import Path
import eyed3
p = Path('.')
for file in p.glob('**/*.mp3'):
mp3 = eyed3.load(file)
if mp3:
title = str(file).split('\\')[1]
print(f"Saving title {title}")
mp3.tag.title=title
mp3.tag.artist='CHANGE_ARTIST'
mp3.tag.album="CHANGE_ALBUM"
mp3.tag.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment