Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Echo off
- Setlocal enableextensions
- ::*********************************************************************************************
- ::*** AutoRipDVD is brought to you by Spinalcracker
- ::*********************************************************************************************
- ::
- ::*********************************************************************************************
- ::*** Change the following variables to match your setup
- ::*********************************************************************************************
- ::
- ::*** DriveLetter=The drive letter of your DVD or Blu-Ray drive ie. D: or G: etc
- ::
- ::------------------------------
- Set DriveLetter=E:
- ::------------------------------
- ::
- ::*** RipDir=Where you want your DVD ripped to ie. your xbmc movie folder *BE SURE TO INCLUDE TRAILING \
- ::
- ::------------------------------
- Set RipDir=I:\HD Movies\
- ::------------------------------
- ::
- ::*** IntDir=Where you installed MakeMKV to
- ::
- ::----------------------------------------
- Set IntDir=C:\Program Files (x86)\MakeMKV
- ::----------------------------------------
- ::
- ::*** ScriptPath is now dynamically hardcoded to wherever the LaunchAutoRipDVD.exe, script will break if you move location of this exe file
- ::
- ::------------------------------------
- Set ScriptPath=%~dp0
- ::------------------------------------
- ::
- ::*** RipMinSeconds=Minimum time in seconds that should be ripped off disk to avoid getting previews etc. Default is 3600 seconds or 1 hour
- ::
- ::---------------------
- Set RipMinSeconds=3600
- ::---------------------
- ::
- ::*** Using Handbrake to compress - Yes or No?
- ::
- ::------------------------------------
- Set Handbrake=No
- ::------------------------------------
- ::
- ::*** Sets the install path to handbrake
- ::
- ::------------------------------------
- Set Handbrakepath=C:\Program Files (x86)\Handbrake\
- ::------------------------------------
- ::
- ::*** Sets the level of compression in Handbrake so unless you really know what you are doing, do NOT adjust this next setting!
- ::
- ::------------------------------------
- Set X264=b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all
- ::------------------------------------
- ::
- ::*** Sets the format of the new compressed file, so again, unless you know what you are doing, please leave it as mkv!
- ::
- ::------------------------------------
- Set FORMAT=--optimize --format mkv
- ::------------------------------------
- ::
- ::*** Sets the quality to something visually appealing but in a small files size - play with this if your outcome isn't to your liking
- ::
- ::------------------------------------
- Set QUALITY=--ab 64 --mixdown mono --quality 23 -e x264 -x %X264%
- ::------------------------------------
- ::
- ::*** Sets the output to 720p resolution - change if you prefer something else
- ::
- ::------------------------------------
- Set SIZE=--width 1280 --height 720
- ::------------------------------------
- ::------------------------------------
- ::
- ::*** Update XBMC Library Upon completion?
- ::*** NOTE: CURL for Windows MUST BE INSTALLED
- :: http://curl.haxx.se/download.html
- ::
- ::------------------------------------
- set UpdateXBMC=Yes
- ::------------------------------------
- ::
- ::*** Which version of XBMC are you using? Enter Frodo or Eden
- ::
- ::------------------------------------
- set XBMCversion=Frodo
- :: Set login details for XBMC HTTP access
- set XBMCuser=xbmc
- set XBMCpass=xbmc
- set XBMCurl=127.0.0.1
- set XBMCport=8082
- set cURLpath=C:\cURL\curl.exe
- ::
- ::*********************************************************************************************
- ::*********************************************************************************************
- ::******* DO NOT EDIT ANYTHING BELOW THIS!!!!!!************************************************
- ::*********************************************************************************************
- ::*********************************************************************************************
- ::For /f %%# In ('Mountvol^|Findstr [d-z]:\\') Do (
- :: Fsutil fsinfo drivetype %%#|Find "CD-ROM">Nul&&(Set "CDROM=%%~d#"))
- ::If Not Defined CDROM call :NoDrive
- for /f "tokens=1-5*" %%1 in ('vol %DriveLetter%') do ( set volid=%%6 & goto processcontd)
- :processcontd
- set nospace=%volid%
- echo [%nospace%]
- echo.
- for /f "tokens=* delims= " %%A in ('echo %nospace% ') do set nospace=%%A
- set nospace=%nospace:~0,-1%
- echo [%nospace%]
- set volid=%nospace%
- echo: %volid%
- :GetDiscNum
- ::Get disc number based on name of %volid%
- "%IntDir%\makemkvcon64.exe" -r --cache=1 info disc:9999 | find /i "%volid%" > "%userprofile%\ARtemp"
- type "%userprofile%\ARtemp"
- set /p discNum=<"%userprofile%\ARtemp"
- del "%userprofile%\ARtemp"
- set discNum=%discNum:~4,1%
- set str=%volid%
- echo.%str%
- set str=%str:_= %
- echo.%str%
- set volid=%str%
- If "%volid%"=="_= " call :NoDrive
- Echo:Ripping %volid% now...
- mkdir "%RipDir%%volid%"
- cd /d "%ScriptPath%"
- OSDAutoRip.hta
- cd /d "%IntDir%"
- makemkvcon64.exe --minlength=%RipMinSeconds% mkv disc:%discNum% all "%RipDir%%volid%"
- SET _tmpPath="%RipDir%%volid%"
- cd /d %_tmpPath%
- for %%i in ("title*.mkv") do (set fname=%%i) & call :rename
- :EndingScripts
- If %Handbrake%==Yes call :HBEncode
- If %UpdateXBMC%==Yes call :UpdateLibrary
- :ScriptComplete
- cd /d "%ScriptPath%"
- AutoRipComplete.vbs
- cscript Beep.vbs
- exit
- :NoDrive
- cd /d "%ScriptPath%"
- cscript Beep.vbs
- NoDiskDrive.hta
- AutoRipComplete.vbs
- exit
- :HBEncode
- cd /d "%Handbrakepath%"
- HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%
- cd /d %_tmpPath%
- del "%volid%_*.mkv"
- SET Handbrake=NULL
- Goto :EndingScripts
- :rename
- ::Cuts off 1st 5 characters of fname, then appends prefix
- ren %fname% "%volid%"_%fname:~5%
- Goto :EndingScripts
- :UpdateLibrary
- If %XBMCversion%==Frodo GOTO :UpdateLibraryFrodo
- If %XBMCversion%==Eden GOTO :UpdateLibraryEden
- GOTO :EndingScripts
- :UpdateLibraryFrodo
- "%cURLpath%" -i -H "Content-Type: application/json" -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\"}" http://%XBMCuser%:%XBMCpass%@%XBMCurl%:%XBMCport%/jsonrpc
- Goto :EndLibraryUpdate
- :UpdateLibraryEden
- "%cURLpath%" --get "http://%XBMCuser%:%XBMCpass%@%XBMCurl%:%XBMCport%/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.updatelibrary(video)"
- Goto :EndLibraryUpdate
- :EndLibraryUpdate
- SET UpdateXBMC=NULL
- cd /d "%ScriptPath%"
- Goto :EndingScripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement