Skip to content

Instantly share code, notes, and snippets.

@TomHeinemeyer
TomHeinemeyer / default_language.py
Last active September 10, 2025 09:54
This script recursively sets the default language for all MKVs in the path it is executed in. It also unsets the default flag for any subtitles.
import pathlib
import subprocess
import simplejson as json
files = [*pathlib.Path('.').glob('**/*.mkv')]
total_items = len(files)
unprocessed_items = []
languages = {}
for file_index, file in enumerate(files):