SHARE
TWEET

Plex Script

DeltaDc12 Feb 24th, 2019 116 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REM This file converts Plex recorded video
  2. SETLOCAL
  3. set LOGFILE=D:\Plex\Plex_Post.log
  4. SET FILENAME=%1
  5. call :encode2mkv >> %LOGFILE%
  6. exit /B
  7.  
  8. :encode2mkv
  9.  
  10. @ECHO off
  11. @ECHO Starting Batch Run: %date% %time%
  12. @ECHO .
  13. @ECHO .
  14. FOR /F "tokens=*" %%G IN ('DIR /B /S %FILENAME%') DO (
  15.    @ECHO Using HandBrakeCLI to Convert file "%%G"
  16. ls -l "%%G"
  17.    @ECHO .
  18.    @ECHO ..
  19.    "C:\Program Files\Handbrake\HandBrakeCLI.exe" -v -i "%%G"  -o "%%~dG%%~pG%%~nG.mkv" --preset-import-file "D:\Plex\720p HD Subs.json" -Z "720p HD Subs"
  20.    @ECHO .
  21.  
  22. REM ### Check if converted file exists ###
  23.    IF EXIST "%%~dG%%~pG%%~nG.mkv" (
  24.       @ECHO Convert Complete for "%%~dG%%~pG%%~nG.mkv"
  25.    ) ELSE (
  26.       ECHO Converted file "%%~dG%%~pG%%~nG.mkv" not found
  27.       ECHO "!!! ERROR RAISED !!!"
  28.         exit 2
  29.    )
  30.  
  31.    @ECHO Deleting old file "%%G"
  32.    del "%%G"
  33. )
  34. @ECHO Batch Run Complete: %date% %time%
  35. @ECHO ##########################################
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top