-
-
Save jameswhite/1252b7e604533d31d434195130c85ba3 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 hidden or 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 | |
{ | |
echo $(date) | |
echo ">>>Disk found" | |
echo ">>>Setting the title..." | |
title=$(makemkvcon -r info) | |
title=`echo "$title" | grep "DRV:0\+"` | |
title=${title:53} | |
len=${#title}-12 | |
title=${title:0:$len} | |
if [[ -z $title ]]; then | |
echo ">>>Couldn't set the title - No disk found" | |
echo ">>>Exit->" | |
exit; | |
else | |
echo ">>>Title set: $title" | |
echo ">>>Starting ripping..." | |
makemkvcon --minlength=4800 -r --decrypt --directio=true mkv disc:0 all /home/user/share > /dev/null | |
mv "/home/user/raid/share/"*.mkv "/home/user/raid/share/"$title.mkv | |
mv "/home/user/raid/share/"$title.mkv "/home/user/raid/share/Movies" | |
eject | |
echo ">>>title: $title.mkv created." | |
fi | |
} &>> "/home/user/autorip.log" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment