Skip to content

Instantly share code, notes, and snippets.

@pjobson
Forked from tacofumi/diskripper.sh
Last active Jul 20, 2021
Embed
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.
#!/bin/bash
# heavily derived from: https://gist.github.com/tacofumi/3041eac2f59da7a775c6
# 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->"
exit;
else
path="/dvr/media/riptemp/${title}"
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."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment