Skip to content

Instantly share code, notes, and snippets.

@CobreDev
Last active September 7, 2020 23:21
Show Gist options
  • Save CobreDev/1ed7eac9f42f76e03b7f12fc50129f7b to your computer and use it in GitHub Desktop.
Save CobreDev/1ed7eac9f42f76e03b7f12fc50129f7b to your computer and use it in GitHub Desktop.
# Put in root directory of music
# Extracts embedded artwork and makes them 300x300 jpgs.
# "$f" = mp3 file name (./Ahrix - Nova.mp3)
# "${f/%mp3/jpg}" = image name (./Ahrix - Nova.jpg)
rm ._*
# rm *.jpg
# Finds all the mp3 files in the current folder and list them to "f" variable
find . -type f -name '*.mp3' -exec sh -c '
for f do
eyeD3 --write-images=. "$f"
mv FRONT_COVER.jpg "${f/%mp3/jpg}"
convert "${f/%mp3/jpg}" -resize 300x300 "${f/%mp3/jpg}"
done' sh {} +
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment