Skip to content

Instantly share code, notes, and snippets.

Forked from tacofumi/
Last active Jul 20, 2021
What would you like to do?
This script rips DVD/Blu-ray using makemkvcon. Use udev to invoke this script to auto-rip when disk is inserted. Some variables such as length of string to trim in order to get the title of movie may vary depending on your environment.
# heavily derived from:
# I mainly simplifed the title generation and made it automatically create a path
echo $(date)
echo "Disk found"
echo "Setting the title..."
title=$(makemkvcon -r info |grep "DRV:0" | sed -E 's/.+,"(.+)","\/dev\/.+"$/\1/')
if [[ -z $title ]]; then
echo "Couldn't set the title - No disk found"
echo "Exit->"
echo "Title set: $title"
echo "Starting ripping..."
$(mkdir -p $path)
makemkvcon --minlength=4800 -r --decrypt --directio=true mkv disc:0 all $path
# eject
echo "$path created."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment