diff --git a/detect_pgs_and_ass_subs.sh b/detect_pgs_and_ass_subs.sh new file mode 100755 index 0000000..239c039 --- /dev/null +++ b/detect_pgs_and_ass_subs.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Function to check if the file contains SSA/ASS subtitles +contains_ssa_ass() { + local file="$1" + if mkvmerge -i "$file" | grep -iq "SubStationAlpha"; then + return 0 # Found SSA/ASS subtitles + else + return 1 # No SSA/ASS subtitles + fi +} + +# Function to check if the file has attachments +check_pgs() { + local file="$1" + if mkvmerge -i "$file" | grep -iq "HDMV PGS"; then + echo "$file" + fi +} + +export -f contains_ssa_ass +export -f check_attachments + +# Find all .mkv files and process them +find . -type f -name "*.mkv" | while read -r file; do + if contains_ssa_ass "$file"; then + check_pgs "$file" + fi +done