You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scripts/detect_pgs_and_ass_subs.sh

30 lines
664 B

#!/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_pgs
# 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