The 'Automatic Cover Tool' software will process your MP3, OGG, WMA, M4A and FLAC files collection and download missed cover images. Album art images are downloaded and saved as image file and/or as image tag in every media file in album. Automatic Cover Tool
#!/bin/bash## Take a pathname as an argument and output a playlist to standard# output and errors to standard error.## The output format is repeated sequences of:## <pathname>\t<artist>\t<title>[\t<bpm>]\n# <pathname>\t<artist>\t<title>[\t<bpm>]\t<genre>\t<date>\t<album>\n## If the tab (\t) or newline (\n) characters appear in a filename,# unexpected things will happen.# DEBUG#set -xPATHNAME="$1"oIFS=$IFSIFS="
"if[`echo"$PATHNAME" | grep -q '.xwaxpls' ; echo$?` -eq 0 ] ; then
cat "$PATHNAME"exit 0
fi
if["$(echo\"$*\" | grep -q -- '--find' ; echo$?)"== 0 ] ; then# support generating playlists based on finding for terms# must be specified like# $ xwax-scan /path/to/music/dir --find search_term1 search_term2...# build find argsfargs=""pathname=$1shift# pop off the music path that we are searchingwhile[$# -gt 0 ] ; do
case"$1"in
--find);;# skip --find*)# assume everything else is a word to search forfargs="$fargs|$1";;esacshift
done
fargs="$(echo$fargs | sed 's:^|::')"files=`find -L "$pathname" -type f -regextype posix-extended -iregex .*\($fargs\).*.\(ogg\|oga\|aac\|cdaudio\|mp3\|flac\|wav\|aif\|aiff\|m4a\|wma\)$`elif["$(echo\"$*\" | grep -q -- '--locate' ; echo$?)"== 0 ] ; then# xwax-scan --locate lavice# xwax-scan --locate '\(lavice\|cyantific\)'files=`locate -i --regexp "$2.*\(ogg\|oga\|aac\|cdaudio\|mp3\|flac\|wav\|aif\|aiff\|m4a\|wma\)$"`elif[ -d "$PATHNAME"] ; then# arg is a directory, they probably want all the music files below itfiles=`find -L "$PATHNAME" -type f | grep -iE '\.(ogg|oga|aac|cdaudio|mp3|flac|wav|aif|aiff|m4a|wma)$'`else
files=$PATHNAMEfi
if[ -x `which mediainfo`] ; then
for f in$files ; do#echo mediainfo --Inform=\"General\;%CompleteName%\t%Performer%\t%Track%\t%BPM%\t%Genre%\t%Recorded_Date%\t%Album%\n\" \"$f\" >&2mi=`mediainfo --Inform="General;%CompleteName%\t%Performer%\t%Track%\t%BPM%\t%Genre%\t%Recorded_Date%\t%Album%\n""$f"`["$mi" !=""]&&echo -e $midone
exit 0
fi
if[ -d "$PATHNAME"]; then
find -L "$PATHNAME" -type f |
grep -iE '\.(ogg|oga|aac|cdaudio|mp3|flac|wav|aif|aiff|m4a|wma)$'else
cat "$PATHNAME"fi |
# Parse artist and title information from matching filenames
sed -n '
{
# /[<ABnum>[.]] <artist> - <title>.ext
s:/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/]*\) \+- \+\([^/]*\)\.[A-Z0-9]*$:\0\t\2\t\3:pi
t
# /<artist> - <album>[/(Disc|Side) <name>]/[<ABnum>[.]] <title>.ext
s:/\([^/]*\) \+- \+\([^/]*\)\(/\(disc\|side\) [0-9A-Z][^/]*\)\?/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/]*\)\.[A-Z0-9]*$:\0\t\1\t\6:pi
t
# /[<ABnum>[.]] <name>.ext
s:/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/]*\)\.[A-Z0-9]*$:\0\t\t\2:pi
}' |
# Extract BPM metadata from title (eg. "Ghostbusters (115.6 BPM)")
sed '
{
# BPM
s:\(.*\) *(\([0-9]\+\.\?[0-9]\+\) *BPM)$:\1\t\2:
}'