add detect pgs and ass subs

main
Gabe Farrell 9 months ago
parent 70d51a1d6c
commit 2e982cde9c

@ -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
Loading…
Cancel
Save