batch file - filebot superstrict script: need tiny video sample or other solution -
seeing how filebot can make massive mistakes (even in strict mode) when renaming videos created script make sure there's no mistakes , lets me check suspicious ones manually.
it uses dummy 0-size copy of video in dedicated folder figure out new name renamed , doesn't tagged video , audio info since it's not real video.
it simpler , more accurate have variable tags in place need tiny part of video (with tracks) instead of 0-size dummy. what's easy way this?
all unknown variables see extrapolated video filename in other script, should not relevant here ask away if need be.
@echo off /f "tokens=*" %%f in ("%full%") ( set "fullpath=%%~dpf" set "file=%%~nxf" ) :: prep fake temp file set tempdir=%temp%\%date:~3,2%%date:~6,2%%date:~11,2%%time:~1,1%%time:~3,2%%time:~6,2% mkdir "%tempdir%" && copy /y nul "%tempdir%\%file%" >nul :: filebot string (to shorten lines) if "%type%"=="film" set cf=--db themoviedb --format "{n} ({y}) {director} {genres} r{rating} {vf} {vc} {ac} {imdbid}" if "%type%"=="show" set cf=--db thetvdb --format "{n} {s00e00} {t} {vf} {vc} {ac}-mallsanta" :: rename fake temp file filebot -rename "%tempdir%\%file%" --q "%name% %year%" %cf% >nul 2>nul :: new name variable /r "%tempdir%" %%i in (*) set "new=%%~nxi" :: declare failure if "%file%"=="%new%" rd /s /q "%tempdir%" & echo no new naming "%new%" & exit /b :: check strings against renamed orphan fake file , if successful rename 4real set "strict=%strict%*" /f "delims=" %%v in ('where "%tempdir%:%strict%" 2^>nul') goto 4real set "strict=%strict:?-?=*%" /f "delims=" %%v in ('where "%tempdir%:%strict%" 2^>nul') goto 4real set "strict=%strict:s?='s?%" /f "delims=" %%v in ('where "%tempdir%:%strict%" 2^>nul') goto 4real :: declare failure , confirm override echo filebot has named "%file%" echo new filename "%new%" unexpected, choice /t 30 /c yn /n /d n /m "override , approve rename? [y]es or [n]o: " if "%errorlevel%"=="1" goto 4real rd /s /q "%tempdir%" exit /b :4real rd /s /q "%tempdir%" filebot -rename "%full%" --q "%name% %year%" %cf% >nul 2>nul :: report , update variables if exist "%full%" echo no change in name "%file%" && exit /b /f "delims=" %%v in ('where "%fullpath%:%strict%" 2^>nul') ( echo correctly renamed "%%~nxv" set "full=%%v" set "file=%%~nv" ) echo renamed "%file%"
i tried split function in mkvmerge terribly slow since wants write out whole file, not single piece. i'm not sure if need video tool here. if knew way copy beginning of file try that.
also questions, comments, caliber suggestions welcomed. i'm starting suspect there might totally different solutions type of filebot
control.
Comments
Post a Comment