From: Alan J. Pippin Date: Thu, 20 Dec 2012 21:08:29 +0000 (-0700) Subject: Added new moviedir option and makemkv only copy largest mkv option. X-Git-Url: http://git.pippins.net/embedvideo/static/%27%20%20%20%20.%20%24GLOBALS%5B%27phpgw%27%5D-%3Elink%28%27inc/jquery/images/x.gif?a=commitdiff_plain;h=9561716cb4b0b2812755889d3899cc8ac53359f9;p=rip_dvd%2F.git Added new moviedir option and makemkv only copy largest mkv option. Added support to get volnames from BluRay disks using makemkv. --- diff --git a/rip_dvd b/rip_dvd index 24d881e..3b846fb 100755 --- a/rip_dvd +++ b/rip_dvd @@ -78,6 +78,7 @@ typeset -i custom_audio_2ch=0 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: @@ -336,9 +337,18 @@ if [ -z "$dvdname" ]; then 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 @@ -1121,7 +1131,7 @@ function make_dvd_mkv_image { 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=$? @@ -1130,22 +1140,24 @@ function make_dvd_mkv_image { 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" diff --git a/rip_dvd.conf.dist b/rip_dvd.conf.dist index 658edda..808ee25 100644 --- a/rip_dvd.conf.dist +++ b/rip_dvd.conf.dist @@ -19,6 +19,9 @@ logdir=/var/log/ripdvd # 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 @@ -78,6 +81,9 @@ mp4box="MP4Box" # 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" diff --git a/rip_dvd.wrap b/rip_dvd.wrap index 95af1e9..3dc8f3a 100755 --- a/rip_dvd.wrap +++ b/rip_dvd.wrap @@ -97,27 +97,27 @@ dvdname=${dvdname%.} # remove trailing '.' character # 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