Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo.>%temp%vdat
- for /f "delims=" %%v in ('dir d:videos /b /s /a-d 2^>nul') do (
- for /f "tokens=2 delims=," %%i in ('ffprobe -v quiet -show_entries "format=duration" -of csv "%%v"') do echo %%i/%%v/%%~zv
- )>>%temp%vdat
- :begin
- for /f "tokens=1,2,3* delims=/" %%i in ('sort "%temp%vdat"') do if exist "%%j" call :strict "%%j" "%%i" "%%k"
- for /f "tokens=1,2,3* delims=/" %%i in ('sort "%temp%vdat"') do if exist "%%j" call :loose "%%j" "%%i" "%%k"
- exit /b
- :strict
- :: if same exact duration+size then remove. blind to filenames. which is nice.
- if "%~2" equ "%lastdura%" if "%~3" equ "%lastsize%" recycle -f "%lastfull%" && echo recycled identical duplicate "%lastfile%"
- set "lastfile=%%~nx1" & set "lastfull=%%~1" & set "lastdura=%%~2" & set "lastsize=%%~3"
- exit /b
- :loose
- :: if same exact duration+size within the megabyte+same start of filename then remove.
- if "%~2" equ "%lastdura%" echo %~3 | findstr /b /c:"%lastsize:~,-6%" >nul && echo "%~nx1" | findstr /i /c:"%lastbite%" >nul && recycle -f "%lastfull%" >nul && echo recycled near-identical "%lastfile%"
- set "lastfile=%%~nx1" & set "lastfull=%%~1" & set "lastdura=%%~2" & set "lastsize=%%~3"
- set "lastbite=%lastfile:~0,21%"
- exit /b
Add Comment
Please, Sign In to add comment