From a956abdf27179337635e8cc5ee54d660b62756a5 Mon Sep 17 00:00:00 2001 From: borja Date: Fri, 24 Apr 2026 12:15:20 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1ade=20comprobaci=C3=B3n=20de=20que=20es?= =?UTF-8?q?=20archivo=20de=20audio=20o=20video?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- whisper.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/whisper.sh b/whisper.sh index 2b1d6d3..9aa6760 100755 --- a/whisper.sh +++ b/whisper.sh @@ -78,6 +78,15 @@ if [ -z "$FILE" ]; then usage fi +EXTENSION="${FILE##*.}" +EXTENSION="${EXTENSION,,}" +VALID_EXTENSIONS="mp3 wav aac ogg flac m4a wma opus aiff alac ape wv amr ac3 dts mka mp4 mkv mov avi webm m4v wmv flv mpg mpeg vob ts mts m2ts 3gp ogv" + +if [[ ! " $VALID_EXTENSIONS " =~ " $EXTENSION " ]]; then + echo "Error: formato no soportado (.${EXTENSION})" + exit 1 +fi + # Verificar si whisper-cli está disponible if ! command -v "$WHISPER_CLI" &>/dev/null; then echo "Error: whisper-cli no se encuentra en $WHISPER_CLI"