21 lines
700 B
Bash
Executable File
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
|