DVR Recording Filename

I put together a windows batch job to parse the JSON for movies .... You can just drag and drop the mpg file or schedule to run on each mpg file. I use the old reliable Dirmon2 to to run it.

Final Destination (2000)
Title=Final Destination (2000)
Description=Death stalks the survivors (Devon Sawa, Ali Larter, Kerr Smith) of a doomed airliner.

CD /d "%~dp0"
set filein="%~f1"
set ext=%~x1

if %ext% EQU .mpg set jsonin=%filein:.mpg=.json%

if %ext% EQU .mpg set

SET /P jsonin=<%jsonin%
set jsonin=%jsonin:"=%

set Title=%jsonin:*,Title=%
Set Title=%Title:~1,-1%

Set Description=%jsonin:*Description:=%
set Description=%Description:Episode=}%
for /f "tokens=1 delims=}" %%a in ("%Description%") do set Description=%%a
Set Description=%Description:~0,-1%

set year=%Title:~-6%
set year=%year:~1,-1%

set Genres=%jsonin:*Genres=%
set Genres=%Genres:IsMovie=}%
for /f "tokens=1 delims=}" %%a in ("%Genres%") do set Genres=%%a
set Genres=%Genres:~2,-2%
set Genres=%Genres:,=/%

echo Title=%Title%>%propin%
echo Description=%Description%>>%propin%
echo Year=%year%>>%propin%
echo Genre=%Genres%>>%propin%


1 Like