Last active
August 14, 2023 17:34
-
-
Save mia-riezebos/01653288b161e14ddf691327bea774d0 to your computer and use it in GitHub Desktop.
organizing your music using exiftool
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
#!/bin/bash | |
# exiftool music organizer | |
# this generates an "artist/album/song"-organized music library (based on metadata) | |
# it also moves and renames songs into this library based on metadata | |
# IN/OUT | |
read -p "Input Directory: " -e INPUT_DIR | |
read -p "Output Directory: " -e OUTPUT_DIR | |
# FORMATS | |
LOSSLESS_FORMAT="${OUTPUT_DIR}/\${albumartist;}/\${date} - \${album;}/\${tracknumber;} \${artist;} - \${title;}.\${FileTypeExtension;}" | |
MP3_FORMAT="${OUTPUT_DIR}/\${albumartist;}/\${date} - \${album;}/\${tracknumber;} \${artist;} - \${title;}.\${FileTypeExtension;}" | |
# EXEC | |
exiftool "-FileName<${LOSSLESS_FORMAT}" -ext flac -ext wav -r $INPUT_DIR | |
exiftool "-FileName<${MP3_FORMAT}" -ext mp3 -r $INPUT_DIR | |
find $INPUT_DIR -empty -type d -delete | |
# working as of 2020-05-14 06:12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo apt install libimage-exiftool-perl