
# Do a super-primitive language guess: ENGLISH `mkvextract tracks "$filename" $tracknumber:"$" > /dev/null 2>&1` Tracknumber=`echo $subline | egrep -o "" | head -1`

Mkvmerge -i "$filename" | grep 'subtitles' | while read subline # Find out which tracks contain the subtitles # Get all the MKV files in this dir and its subdirsįind "$DIR" -type f -name '*.mkv' | while read filename # If no directory is given, work in local dir # Extract subtitles from each MKV file in the given directory sudo apt-get install mkvtoolnixĪnother tip now because mkv files may contain many subtitles, so the tip is this script that you can search for the language you want, so for example if you want English it will download just English.
