typeset -i custom_audio_6ch=0
typeset -i minimum_feature_title_length=60
typeset -i lsdvd_timeout=10
+typeset -i makemkv_copy_largest_title_only=1
##############################################################################
# Local Machine Settings:
echo "-E- Can't access the DVD device $dev"
exit 1
fi
+
# now capture the volume name from the device
dvdname=`volname $dev | awk '{ print $1 }'`
ripdvd=1
+
+ # if the dvdname is still blank, go about it a different way (for BluRays)
+ if [[ -z "$dvdname" ]]; then
+ echo "-> Using makemkv to obtain disk label"
+ dvdname=`$makemkv info --noscan --robot disc:$makemkv_disc_id | grep "CINFO:2," | awk -F "," '{ print $3; }' | tr ' ' '_' | sed 's/\"//g'`
+ echo " Found disk label: $dvdname"
+ ripdvd=1
+ fi
else
dstdir=${dstmkv%.[^.]*}
((min_length = minimum_feature_title_length * 60))
- echo -e "\n Ripping: $makemkv --minlength=$min_length --decrypt --progress=-same $srctype:$srcname all $dstdir"
+ echo -e "\n Ripping: $makemkv mkv --minlength=$min_length --decrypt --progress=-same $srctype:$srcname all $dstdir"
mkdir -p "$dstdir"
$makemkv mkv --minlength=$min_length --decrypt --progress=-same $srctype:$srcname all $dstdir 2>&1 | tee -a "$ddrescuelog"
makemkv_retval=$?
fatal_and_exit "-E- Unhandled makemkv error"
fi
- # Move the largest created MKV file into place
- # There might be multiple ones, so just grab the largest one
- largest_mkv_file=`/bin/ls -1S "$dstdir"/*.mkv | head -1`
- echo -e "\n Moving largest mkv file $largest_mkv_file -> $dstmkv\n" | tee -a "$ddrescuelog"
- mv "$largest_mkv_file" "$dstmkv"
-
- # Move all of the created MKV file into place
- #echo "\n" | tee -a "$ddrescuelog"
- #dstfile=${dstmkv%.[^.]*}
- #typeset -i num=0
- #for i in `/bin/ls -1 "$dstdir"/*.mkv`; do
- #echo -e " Moving $i -> $dstfile.$num.mkv" | tee -a "$ddrescuelog"
- #mv "$i" "$dstfile.$num.mkv"
- #((num = num + 1 ))
- #done
- #echo "\n" | tee -a "$ddrescuelog"
+ if [ $makemkv_copy_largest_title_only -eq 1 ]; then
+ # Move the largest created MKV file to destination
+ # There might be multiple ones, so just grab the largest one
+ largest_mkv_file=`/bin/ls -1S "$dstdir"/*.mkv | head -1`
+ echo -e "\n Moving largest mkv file $largest_mkv_file -> $dstmkv\n" | tee -a "$ddrescuelog"
+ mv "$largest_mkv_file" "$dstmkv"
+ else
+ # Move all of the created MKV files to destination
+ echo "\n" | tee -a "$ddrescuelog"
+ dstfile=${dstmkv%.[^.]*}
+ typeset -i num=0
+ for i in `/bin/ls -1 "$dstdir"/*.mkv`; do
+ echo -e " Moving $i -> $dstfile.$num.mkv" | tee -a "$ddrescuelog"
+ mv "$i" "$dstfile.$num.mkv"
+ ((num = num + 1 ))
+ done
+ echo "\n" | tee -a "$ddrescuelog"
+ fi
if [ $? != 0 ]; then
fatal_and_exit "-E- Unhandled mv error"
# Specify the path to the tmp rip directory
tmpdir=/myth/video/DVDs/.ripdvd
+# Specify the path to the base destination dir for ripped movies
+moviedir=/myth/video/Movies
+
# Specify the email address to send job notifications to
mailto=root
# Set the disc_id option to be the ID of the DVD drive in your system
makemkv="makemkvcon"
makemkv_disc_id="0"
+makemkv_copy_largest_title_only=1
+
+# MKV Tools
# http://www.bunkus.org/videotools/mkvtoolnix/
mkvextract="mkvextract"
mkvpropedit="mkvpropedit"
# since these are only kept around until we watch them,
# there is no need to do anything less than full iso.
# - collection = Only DVD main feature is ripped
-# - childrens = Only DVD main feature is ripped
+# - children = Only DVD main feature is ripped
# - church = Only DVD main feature is ripped
rip_opts="$* -j 2"
if [ "$dvdtype" == "netflix" ]; then
echo "-> Ripping Netflix DVD"
- dest=/myth/video/Movies/Netflix
+ dest="$moviedir/Netflix"
rip_opts="$rip_opts"
elif [ "$dvdtype" == "collection" ]; then
echo "-> Ripping Personal Collection DVD"
- dest=/myth/video/Movies/Collection
+ dest="$moviedir/Collection"
rip_opts="$rip_opts"
-elif [ "$dvdtype" == "childrens" ]; then
+elif [ "$dvdtype" == "children" ]; then
echo "-> Ripping Children's DVD"
- dest=/myth/video/Movies/Childrens
+ dest="$moviedir/Children"
rip_opts="$rip_opts"
elif [ "$dvdtype" == "church" ]; then
echo "-> Ripping Church DVD"
- dest=/myth/video/Movies/Church
+ dest="$moviedir/Church"
rip_opts="$rip_opts"
else
- echo '-E- Must specify dvdtype as "netflix" or "collection" or "childrens" or "church"'
+ echo '-E- Must specify dvdtype as "netflix" or "collection" or "children" or "church"'
exit 1
fi