Files
Server-scripts/quiethost/album_art.sh
T
2026-09-14 12:43:38 +02:00

21 lines
700 B
Bash
Executable File

FFMPEG="true"
if [ "$2" == "" ]; then
for file in *mp3; do
if [[ "${FFMPEG}" == "true" ]]; then
ffmpeg -i "$file" -i /home/lucas/Downloads/$1 -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" "$file.mp3"
else
lame --ti /home/lucas/Downloads/$1 "$file"
fi
mv "$file.mp3" "$file"
done
else
for file in "$2"; do
if [[ "${FFMPEG}" == "true" ]]; then
ffmpeg -i "$file" -i /home/lucas/Downloads/$1 -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" "$file.mp3"
else
lame --ti /home/lucas/Downloads/$1 "$file"
fi
mv "$file.mp3" "$file"
done
fi