Created
August 26, 2022 18:29
-
-
Save koss822/bc063c9c588f11a8ddd9898e5b2c3266 to your computer and use it in GitHub Desktop.
Add ID3 tag to MP3 in current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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