Bonjour,
tout est dans le titre.
On pourra visualiser ou écrire/modifier les tags dans ses fichiers audios sans avoir recours à un gui.
Sous Debian:
Sous Archlinux:
Rendre exécutable le script et le copier dans /usr/local/bin
cp taginfo /usr/local/bin
Ouvrir un terminal dans un dossier contenant les fichiers et lancer la commande :
Le script :
#!/bin/bash
#https://www.developpez.net/forums/d1095933/systemes/autres-systemes/unix/suppression-espaces-fin-chaine/#post6060958
# songname[max:30]: Our Kick Ass Demo
# artist[max:30]: Us
# album[max:30]: White Album
# year[max:4]: 1999
# comment[max:28]: Will be a classic some day!
# tracknum[max:3]: 1
# genre[0-255/name]: 5
for i in {*.flac,*.mp3} ; do
id3 "$i"
PERFORMER=$(id3 "$i" | grep "Artist:" | sed 's/.*://' | sed "s/^\ \ *//")
echo ""
read -r -p "ARTISTE: $PERFORMER ? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo -e "\e[32m$PERFORMER\e[0m"
id3 -a "$PERFORMER" "$i"
;;
[nN][oO]|[nN])
read -r -p "Entrer ARTISTE: " PERFORMER
echo -e "\e[32m$PERFORMER\e[0m écrit."
if [[ -z "$PERFORMER" ]]; then
echo "Invalid input..."
echo "Quit"
exit 1
else
id3 -a "$PERFORMER" "$i"
fi
;;
*)
echo "Invalid input..."
echo "Quit"
exit 1
;;
esac
ALBUM=$(id3 "$i" | grep "Album" | sed 's/.*://' | sed "s/^\ \ *//")
echo ""
read -r -p "ALBUM: $ALBUM ? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
echo -e "\e[32m$ALBUM\e[0m"
id3 -l "$ALBUM" "$i"
;;
[nN][oO]|[nN])
read -r -p "Entrer ALBUM: " ALBUM
echo -e "\e[32m$ALBUM\e[0m écrit."
if [[ -z "$ALBUM" ]]; then
echo "Invalid input..."
echo "Quit"
exit 1
else
id3 -l "$ALBUM" "$i"
fi
;;
*)
echo "Invalid input..."
echo "Quit"
exit 1
;;
esac
TITLE=$(id3 "$i" | grep "Title:" | sed 's/.*://' | sed "s/^\ \ *//")
echo ""
read -r -p "TITRE: $TITLE ? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
echo -e "\e[32m$TITLE\e[0m"
id3 -t "$TITLE" "$i"
;;
[nN][oO]|[nN])
read -r -p "Entrer TITLE: " TITLE
echo -e "\e[32m$TITLE\e[0m écrit."
if [[ -z "$TITLE" ]]; then
echo "Invalid input..."
echo "Quit"
exit 1
else
id3 -t "$TITLE" "$i"
fi
;;
*)
echo "Invalid input..."
echo "Quit"
exit 1
;;
esac
YEAR=$(id3 "$i" | grep "Year:" | sed 's/.*://' | sed "s/^\ \ *//")
echo ""
read -r -p "ANNÉE: $YEAR ? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
echo -e "\e[32m$YEAR\e[0m"
id3 -y "$YEAR" "$i"
;;
[nN][oO]|[nN])
read -r -p "Entrer Année: " YEAR
echo -e "\e[32m$YEAR\e[0m écrit."
if [ "${YEAR}" == "" ]; then
echo "Invalid input..."
echo "Quit"
exit 1
else
id3 -y "$YEAR" "$i"
fi
;;
*)
echo "Invalid input..."
echo "Quit"
exit 1
;;
esac
GENRE=$(id3 "$i" | grep "Genre:" | sed 's/.*://' | sed "s/^\ \ *//")
echo ""
read -r -p "GENRE: $GENRE ? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
echo -e "\e[32m$GENRE\e[0m"
id3 -g "$GENRE" "$i"
;;
[nN][oO]|[nN])
read -r -p "Entrer Genre: " GENRE
echo -e "\e[32m$GENRE\e[0m écrit."
if [ "${GENRE}" == "" ]; then
echo "Invalid input..."
echo "Quit"
exit 1
else
id3 -g "$GENRE" "$i"
fi
;;
*)
echo "Invalid input..."
echo "Quit"
exit 1
;;
esac
COMMENT=$(id3 "$i" | grep "Comment" | sed 's/.*://' | sed "s/^\ \ *//")
echo ""
read -r -p "COMMENTAIRES: $COMMENT ? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
echo -e "\e[32m$COMMENT\e[0m"
id3 -c "$COMMENT" "$i"
;;
[nN][oO]|[nN])
read -r -p "Entrer Commentaires: " COMMENT
echo -e "\e[32m$COMMENT\e[0m écrit."
if [ "${COMMENT}" == "" ]; then
echo "Invalid input..."
echo "Quit"
exit 1
else
id3 -c "$COMMENT" "$i"
fi
;;
*)
echo "Invalid input..."
echo "Quit"
exit 1
;;
esac
done
Je n'ai mis que les choix :
Artist
Album
Title
Year
Genre
Comment
mais vous pouvez très bien en rajouter :
Voilà pour tester
Dernière modification par Anonyme (28-07-2020 11:12:08)