Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: AutoRipDVD is brought to you by Spinalcracker
- :: Modified by Akevit
- :: Modified again by Jason Hurley :) :
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- @Echo on
- Setlocal enableextensions
- :: Enable Delayed Expansion allows for loops to iterate through each variable by using ! instead of % when calling variable
- Setlocal enabledelayedexpansion
- :: ScriptPath is now dynamically hardcoded to wherever the AutoRipDVD.bat file is, script will break If you move location of this file
- Set ScriptPath=%~dp0
- Set ScriptPath=%ScriptPath:~0,-1%
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: 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=D:
- :: RipDir=Where you want your DVD ripped to ie. your xbmc movie folder
- Set RipDir=G:\UncompressedMovies
- :: Encoded Directory of where it saves
- Set EncodeDir=G:\movies\
- :: IntDir=Where you installed MakeMKV to
- Set IntDir=C:\Program Files (x86)\MakeMKV
- :: 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
- :: Eject Disc after ripping?
- Set EjectDisc=No
- :: Show splash screens
- Set ShowSplash=No
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::: Media Companion
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :::Open MediaCompanion. Since there was no installation, you just run the downloaded executable. Select the “Movies” tab in the first row, and then the
- ::“Folders” tab in the second row. Click “Add Movie Folder Browser” and navigate to wherever you’re storing your movies. Click OK, and then click
- ::“Save & Quick Refresh”. MC will search the folder(s) you specified for media items. Note that it hasn’t scraped anything yet.
- ::On the second tab row (still in Movies) select “Movie Preferences”. These settings are all optional, except that “Use Folder Names for Scraping”
- ::(near the bottom left) MUST be checked.
- :: Sets Media Companion Directory ( For those that use this setting make sure you look at XMBC Set Scan of media Companion
- :: http://mediacompanion.codeplex.com/ (requires .net 4.0)
- Set MediaDir=c:\MediaCompanion3.500
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: HANDBRAKE SETTINGS
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Sets the install path to handbrake
- Set Handbrakepath=C:\Program Files\Handbrake
- :: Log Handbrake?
- Set Handbrakelog=Yes
- Set HandbrakelogDirectory=%scriptpath%
- :: Experimental procedure to only encode the largest extracted MKV and append .delete to the others and delete
- Set encodeLargestOnly=Yes
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::: HANDBRAKE SETTINGS PART 2 - Below Settings do not matter if Advanced mode is on
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Using Handbrake to compress - Yes or No?
- Set Handbrake=Yes
- :: Keep backup of original file after compression? (Otherwise original full quality video will be deleted from Hard Drive -- They're quite large)
- Set KeepHDVersion=Yes
- :: Enter profile For handbrake settings to use (see end of this file)
- Set HBsettings=1080pHigh
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: XBMC Settings For Library Update
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Media Companion Folders need to be Set in Media Companion Prior To Running this Scan.
- ::Sets Scan of Media Companion
- Set MediaComp=Yes
- :: Update XBMC Library Upon completion?
- :: NOTE: CURL For Windows MUST BE INSTALLED: http://curl.haxx.se/download.html
- Set UpdateXBMC=Yes
- :: Add arbitrary NFO.txt file For file If wanted
- :: Will need to manually add URL to NFO file For scraper to work
- Set AddNFO=No
- ::*** Which version of XBMC are you using? Enter FroDo or Eden
- Set XBMCversion=Frodo
- :: Set logIn details For XBMC HTTP access (settings found In XBMC Network settings)
- Set XBMCuser=xbmc
- Set XBMCpass=xbmc
- Set XBMCurl=127.0.0.1
- Set XBMCport=8082
- Set cURLpath=C:\cURL\curl.exe
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Debug Test Mode
- Set TestMode=No
- ::*********************************************************************************************
- ::*********************************************************************************************
- ::******* Do NOT EDIT ANYTHING BELOW THIS!!!!!!************************************************
- ::*********************************************************************************************
- ::*********************************************************************************************
- :StartScript
- :: Set volid = label name
- For /f "tokens=1-5*" %%1 In ('vol %DriveLetter%') Do (
- Set volid=%%6
- Goto :processcontd
- )
- :processcontd
- :: Remove trailing space from label name if exists
- If "%volid:~-1,1%"==" " Set volid=%volid:~0,-1%
- Echo Volid:[%volid%]
- :GetDiscNum
- :: Get disc number based on name of %volid%
- "%IntDir%\makemkvcon64.exe" -r --cache=1 info disc:9999 | Find /i "%volid%" > "%userprofile%\ARtemp"
- Set /p discNum=<"%userprofile%\ARtemp"
- Del "%userprofile%\ARtemp"
- Set discNum=%discNum:~4,1%
- :: Checking For drive
- Set str=%volid%
- Set str=%str:_= %
- Set volid=%str%
- If "%volid%"=="_= " Call :NoDrive
- Echo:Ripping %volid% now...
- Echo %date% %time%: Begin Script [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- :: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- :: Go to AdvancedMode
- Call :AdvancedModeOption
- cd /d %ScriptPath%
- Set /p AdvancedMode=<value.txt
- del value.txt
- If %AdvancedMode%==1 GoTo :Advanced
- :: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- :: Creating directory to rip DVD as an MKV to
- Mkdir "%RipDir%\%volid%"
- :: Launch AutoRip splash screen
- If %ShowSplash%==Yes Call "%ScriptPath%\OSDAutoRip.hta"
- :: Ripping DVD to MKV file
- Cd /d "%IntDir%"
- Echo %date% %time%: Ripping [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- :: Rip with MakeMKV?
- if not exist "%RipDir%\%volid%\*.mkv" call :Rip_With_MakeMKV
- ::Check if more than one file exists for uncompressed mkv and deletes all but biggest
- ::!!!!!!!!!!!!!!!!!!!!!!!!!
- ::Cd /d %RipDir%%volid%
- ::for /f "skip=1delims=" %%i in ( ' dir /b /a-d /o-d "*.mkv" ' ) do ECHO del
- ::!!!!!!!!!!!!!!!!!!!!!!!!!!!
- If %encodeLargestOnly%==Yes Call :renameSmallerMKVs
- ::Change Ripped File Name
- cd /d %RipDir%\%volid%
- if not exist "%volid%.mkv" Call :rename
- ::Handbrake Compression
- If %Handbrake%==Yes Call :HBEncode
- :AdvancedExit
- :EndingScripts
- If %MediaComp%==Yes Call :MediaComp
- If %UpdateXBMC%==Yes Call :UpdateLibrary
- If %AddNFO%==Yes Call :AddNFOscript
- :ScriptComplete
- Cd /d "%ScriptPath%"
- If %EjectDisc%==Yes Call AutoRipComplete.vbs
- Echo %date% %time%: End Script [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- cscript Beep.vbs
- PAUSE
- EXIT
- :: Start of various ending scripts
- :NoDrive
- Cd /d "%ScriptPath%"
- Echo %date% %time%: End Script [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- cscript Beep.vbs
- NoDiskDrive.hta
- AutoRipComplete.vbs
- EXIT
- :Rip_With_MakeMKV
- makemkvcon64.exe --minlength=%RipMinSeconds% mkv disc:%discNum% all "%RipDir%\%volid%"
- Echo %date% %time%: Rip complete [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- Goto :EOF
- :HBEncode
- Mkdir "%EncodeDir%\%volid%"
- Call :%HBsettings%
- Echo %date% %time%: BegIn HB Encode [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- Cd /d "%Handbrakepath%"
- HandBrakeCLI -v0 -i "%RipDir%\%volid%" -o "%EncodeDir%\%volid%\%volid%.%RESOLUTION%.mkv" %PICTURE% %VIDEO% %AUDIO% %ADVANCED%
- ECHO %date% %time%: End HB Encode [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- :: Setting Handbrakelog, double quotes necessary otherwise output won't be written
- ::If %Handbrakelog%==Yes Set LOG="--verbose=1 2> "%HandbrakelogDirectory%\HandbrakeLog.txt""
- Cd /d "%RipDir%%volid%"
- If %KeepHDVersion%==No Del "%volid%_*.mkv"
- Goto :EOF
- :renameSmallerMKVs
- Dir "%RipDir%\%volid%\*.mkv" /b /o-s>{temp}
- Set /P biggestMKV=<{temp}
- Del {temp}
- For %%f In ("%RipDir%\%volid%\*.mkv") Do (
- If Not "%%f"=="%RipDir%\%volid%\%biggestMKV%" (
- Ren "%%f" *.delete
- )
- )
- Del "%RipDir%\%volid%\*.delete"
- Goto :EOF
- :HBEncodeLogSection
- ECHO %date% %time%: End HB Encode [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- Goto :EOF
- :rename
- cd /d "%RipDir%\%volid%"
- ren "*.mkv" "%volid%.mkv"
- GoTo :EOF
- :MediaComp
- Cd /d %MediaDir%
- mc_com.exe -m
- Goto :EOF
- :AddNFOscript
- Echo http://www.themoviedb.org/movie/ > "%RipDir%\%volid%\%titlename%.NFO.ADD URL FROM TMDB or TVDB WHEN NEEDED.txt"
- Goto :EOF
- :UpdateLibrary
- If %XBMCversion%==FroDo Goto :UpdateLibraryFrodo
- If %XBMCversion%==Eden Goto :UpdateLibraryEden
- Goto :EOF
- :UpdateLibraryFrodo
- "%cURLpath%" -i -H "Content-Type: application/json" -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\"}" http://%XBMCuser%:%XBMCpass%@%XBMCurl%:%XBMCport%/jsonrpc
- Goto :EOF
- :UpdateLibraryEden
- "%cURLpath%" --get "http://%XBMCuser%:%XBMCpass%@%XBMCurl%:%XBMCport%/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.updatelibrary(video)"
- Goto :EOF
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::AdvancedMode Script Input
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::::::::::;DO NOT EDIT::::::::::::::::::::::::::::::::::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :Advanced
- :: Creating directory to rip DVD as an MKV to
- Mkdir "%RipDir%\%volid%"
- :: Launch AutoRip splash screen
- If %ShowSplash%==Yes Call "%ScriptPath%\OSDAutoRip.hta"
- :: Ripping DVD to MKV file
- Cd /d "%IntDir%"
- Echo %date% %time%: Ripping [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- cd /d %ScriptPath%
- del Advanced.txt
- del value.txt
- ::Choice about MKV
- cd /d "%RipDir%\%volid%"
- call :RiptoMKV
- cd /d %ScriptPath%
- Set /p RiptoMKV=<value.txt
- del value.txt
- Call :EncodeWithHandbrake
- cd /d %ScriptPath%
- Set /p EncodewithHandbrake=<value.txt
- del value.txt
- Call :KeepUncompressedVersion
- cd /d %ScriptPath%
- Set /p KeepUncompressed=<value.txt
- del value.txt
- If %EncodewithHandbrake%==1 Call :EncodingSettings
- Cd /d "%IntDir%"
- If %RiptoMKV%==1 Call :Rip_With_MakeMKV
- ::Change Ripped File Name
- ::cd /d %RipDir%\%volid%
- ::if not exist "%volid%.mkv" goto :rename
- ::Check if more than one file exists for uncompressed mkv and deletes all but biggest
- ::!!!!!!!!!!!!!!!!!!!!!!!!!
- ::Cd /d %RipDir%%volid%
- ::for /f "skip=1delims=" %%i in ( ' dir /b /a-d /o-d "*.mkv" ' ) do ECHO del
- ::!!!!!!!!!!!!!!!!!!!!!!!!!!!
- If %encodeLargestOnly%==Yes Call :renameSmallerMKVs
- if not exist "%volid%.mkv" Call :rename
- If %EncodewithHandbrake%==1 Call :AdvancedHandbrake
- If %KeepUncompressed%==2 Call :DeleteOriginal
- GoTo :AdvancedExit
- ::Encoding Section for Handbrake
- :AdvancedHandbrake
- Mkdir "%EncodeDir%\%volid%"
- ::Call :EncodingSettings
- ::cd /d %ScriptPath%
- ::Set /p EncodingSettings=<value.txt
- ::del value.txt
- If %EncodingSettings%==1 Call :720pLow
- If %EncodingSettings%==2 Call :720pMedium
- If %EncodingSettings%==3 Call :720pHigh
- If %EncodingSettings%==4 Call :1080pLow
- If %EncodingSettings%==5 Call :1080pMedium
- If %EncodingSettings%==6 Call :1080pHigh
- Echo %date% %time%: BegIn HB Encode [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- Cd /d "%Handbrakepath%"
- HandBrakeCLI -v0 -i "%RipDir%\%volid%" -o "%EncodeDir%\%volid%\%volid%.%RESOLUTION%.mkv" %PICTURE% %VIDEO% %AUDIO% %ADVANCED%
- ECHO %date% %time%: End HB Encode [%volid%] >> "%scriptpath%\AutoRipLog.txt"
- :: Setting Handbrakelog, double quotes necessary otherwise output won't be written
- ::If %Handbrakelog%==Yes Set LOG="--verbose=1 2> "%HandbrakelogDirectory%\HandbrakeLog.txt""
- Goto :EOF
- :DeleteOriginal
- Cd /d "%RipDir%\%volid%"
- Del "%volid%*.mkv"
- Cd /d "%RipDir%"
- Del "%volid%"
- Goto :EOF
- :RiptoMKV
- cd /d %ScriptPath%
- del Advanced.txt
- Set Rip=1
- echo %Rip% >>Advanced.txt
- start /wait Advanced.bat
- del Advanced.txt
- GoTo :EOF
- :EncodewithHandbrake
- cd /d %ScriptPath%
- del Advanced.txt
- Set Encode=2
- echo %Encode% >>Advanced.txt
- start /wait Advanced.bat
- del Advanced.txt
- GoTo :EOF
- :EncodingSettings
- cd /d %ScriptPath%
- del Advanced.txt
- Set EnSettings=3
- echo %EnSettings% >>Advanced.txt
- start /wait Advanced.bat
- del Advanced.txt
- cd /d %ScriptPath%
- Set /p EncodingSettings=<value.txt
- del value.txt
- GoTo :EOF
- :KeepUncompressedVersion
- cd /d %ScriptPath%
- del Advanced.txt
- Set Keep=4
- echo %Keep% >>Advanced.txt
- start /wait Advanced.bat
- del Advanced.txt
- GoTo :EOF
- :SelectFile
- cd /d %ScriptPath%
- del Advanced.txt
- Set Select=5
- echo %Select% >>Advanced.txt
- start /wait Advanced.bat
- del Advanced.txt
- GoTo :EOF
- :AdvancedModeOption
- cd /d %ScriptPath%
- del Advanced.txt
- Set AMO=6
- echo %AMO% >>Advanced.txt
- start /wait Advanced.bat
- del Advanced.txt
- GoTo :EOF
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Change or add Handbrake Settings here :
- :: Format follows the tabs In handbrake, PICTURE settings include video filter as this is how it's referenced In the CLIGuide :
- :: For full explanations of settings, see here: https://trac.handbrake.fr/wiki/CLIGuide :
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :OriginalSettings
- Set RESOLUTION=720p
- Set PICTURE=--format mkv --width 1280
- Set VIDEO=-m -e x264 --quality 23
- Set AUDIO=--ab 64 --mixdown mono
- Set ADVANCED=-x 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
- Goto :EOF
- :1080pLow
- Set RESOLUTION=1080p
- Set PICTURE=-f mkv -w 1920 --height 1080 --loose-anamorphic
- Set VIDEO=-m -e x264 -q 20 -r 29.97 --pfr
- Set AUDIO=-a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3
- Set ADVANCED=--x264-profile high
- Goto :EOF
- :1080pMedium
- Set RESOLUTION=1080p
- Set PICTURE=-f mkv --decomb -w 1920 --height 1080 --loose-anamorphic --modulus 2
- Set VIDEO=-m -e x264 -q 20 --vfr
- Set AUDIO=-a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3
- Set ADVANCED=-x b-adapt=2:rc-lookahead=50
- Goto :EOF
- :1080pHigh
- Set RESOLUTION=1080p
- Set PICTURE=-f mkv --decomb -w 1920 --height 1080 --crop 0:0:0:0 --loose-anamorphic --modulus 2
- Set VIDEO=-m -e x264 -q 20 --vfr
- Set AUDIO=-a 1,1 -E faac,copy:ac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3
- Set ADVANCED=-x b-adapt=2:rc-lookahead=50:ref=6:bframes=6:me=umh:subq=9:merange=64:analyse=all
- Goto :EOF
- :720pLow
- Set RESOLUTION=720p
- Set PICTURE=-f mkv -w 1280 --loose-anamorphic
- Set VIDEO=-m -e x264 -q 20 -r 29.97 --pfr
- Set AUDIO=-a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3
- Set ADVANCED=--x264-profile high
- Goto :EOF
- :720pMedium
- Set RESOLUTION=720p
- Set PICTURE=-f mkv --decomb -w 1280 --loose-anamorphic --modulus 2
- Set VIDEO=-m -e x264 -q 20 --vfr
- Set AUDIO=-a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3
- Set ADVANCED=-x b-adapt=2:rc-lookahead=50
- Goto :EOF
- :720pHigh
- Set RESOLUTION=720p
- Set PICTURE=-f mkv --decomb -w 1920 --height 1080 --crop 0:0:0:0 --loose-anamorphic --modulus 2
- Set VIDEO=-m -e x264 -q 20 --vfr
- Set AUDIO=-a 1,1 -E faac,copy:ac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3
- Set ADVANCED=-x b-adapt=2:rc-lookahead=50:ref=6:bframes=6:me=umh:subq=9:merange=64:analyse=all
- Goto :EOF
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement