nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

gotcover (601B)


      1 #!/bin/bash
      2 # Check media files for embedded cover art using ffmpeg/ffprobe
      3 
      4 SEARCH_DIR="${1:-.}"
      5 EXTENSIONS=("flac" "mp3" "aiff" "aif" "m4a" "ogg" "wav")
      6 
      7 find_args=()
      8 for i in "${!EXTENSIONS[@]}"; do
      9 	if [ "$i" -gt 0 ]; then
     10 		find_args+=(-o)
     11 	fi
     12 	find_args+=(-iname "*.${EXTENSIONS[$i]}")
     13 done
     14 
     15 while IFS= read -r -d '' file; do
     16 	has_cover=$(ffprobe -v error -select_streams v -show_entries stream=codec_type -of csv=p=0 "$file" 2>/dev/null | grep -c "video")
     17 
     18 	if [ "$has_cover" -eq 0 ]; then
     19 		echo "[✗] $file"
     20 	fi
     21 done < <(find "$SEARCH_DIR" -type f \( "${find_args[@]}" \) -print0 | sort -z)