Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mutagen.mp4 import MP4
- from mutagen.easyid3 import EasyID3
- import os
- albums = next(os.walk('.'))[1]
- for album in albums:
- songs = [f for f in os.listdir(album) if f.endswith(".mp3") or f.endswith(".m4a")]
- for song in songs:
- print("Albumizing {}/{}...".format(album, song))
- try:
- if song.endswith(".mp3"):
- song = EasyID3("{}/{}".format(album, song))
- song["album"] = album
- song.save()
- # print(song)
- elif song.endswith(".m4a"):
- song = MP4("{}/{}".format(album, song))
- song["\xa9alb"] = [album]
- song.save()
- # print(song)
- except:
- print("Failed to albumize, fuck :(")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement