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.

33 lines
1020 B

#!/bin/bash
# Check if mkvpropedit is installed
if ! command -v mkvpropedit &> /dev/null; then
echo "Error: mkvpropedit is not installed. Install mkvtoolnix package."
exit 1
fi
# Check if a directory is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <directory>"
exit 1
fi
DIRECTORY="$1"
# Check if directory exists
if [ ! -d "$DIRECTORY" ]; then
echo "Error: Directory '$DIRECTORY' not found."
exit 1
fi
# Find and process all .mkv files in the directory
find "$DIRECTORY" -type f -name "*.mkv" | while read -r MKV_FILE; do
echo "Processing: $MKV_FILE"
mkvpropedit "$MKV_FILE" --attachment-mime-type "application/x-font-otf" --update-attachment "mime-type:application/vnd.ms-opentype"
mkvpropedit "$MKV_FILE" --attachment-mime-type "application/x-font-otf" --update-attachment "mime-type:font/otf"
mkvpropedit "$MKV_FILE" --attachment-mime-type "application/x-font-ttf" --update-attachment "mime-type:font/ttf"
done
echo "All applicable MKV files updated successfully."