-
-
Save pjobson/aa59f7968217521a0ad6cf11b3e22e5b to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) | |
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 | |
echo "Disk found" | |
echo "Setting the title..." | |
path="/dvr/media/riptemp/${title}" | |
echo "Title set: $title" | |
echo "Starting ripping..." | |
$(mkdir -p $path) | |
# Set the minlength here to 4800 or something larger to not rip | |
# everything, I set to 0 to get everything on the disc. | |
makemkvcon --minlength=0 -r --decrypt --directio=true mkv disc:0 all $path | |
# eject | |
echo "Output: $path" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment