tag.sh: add track option

This commit is contained in:
dogeystamp 2023-04-13 22:05:09 -04:00
parent 23e3f501fe
commit 2cc7ec8450
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -5,9 +5,14 @@ cat "$TMPFILE" | while read line; do
link="$(echo $line | awk -F";" '{print $1}')"
artist="$(echo $line | awk -F";" '{print $2}')"
alb="$(echo $line | awk -F";" '{print $3}')"
file="$artist-$alb"
trk="$(echo $line | awk -F";" '{print $4}')"
file="$artist-$alb-$trk"
yt-dlp "$link" -x --audio-format mp3 --no-playlist -o "$file.%(ext)s"
mid3v2 -a "$artist" "$file"*
mid3v2 -A "$alb" "$file"*
mid3v2 -t "$alb" "$file"*
if [ -z "$trk" ]; then
mid3v2 -t "$alb" "$file"*
else
mid3v2 -t "$trk" "$file"*
fi
done