Created
August 11, 2017 04:27
-
-
Save tomoyat1/fd090d3d620da1e52fcf04eee2359328 to your computer and use it in GitHub Desktop.
Script to extract cover art from music, organized as artist/album/track
This file contains hidden or 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/zsh | |
for ar in ./*; do | |
if [ -d $ar ]; then | |
for al in $ar/*; do | |
alname=$(echo $al | cut -d'/' -f3) | |
coverart=$al/$alname.jpg | |
firstfile=$al/$(ls $al | head -1) | |
echo "dir:\t\t$al" | |
echo "coverart:\t$coverart" | |
echo "first file:\t$firstfile" | |
echo "\n" | |
ffmpeg -i "$firstfile" "$coverart" | |
done | |
else | |
echo "Ignoring file" $ar | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment