nscripthelper - sub3/NextPVR GitHub Wiki

nscripthelper

The nscripthelper program can be used in a batch or command or script files to perform functions that include renaming recordings and updating the EPG.

nscripthelper can be executed from a command or script file or from a command or terminal prompt. An example command file to reboot Windows is ... here

For Windows ... nscripthelper is available as a .exe in C:\Program Files\NextPVR

For Linux ... nscripthelper is available as a .dll and requires .NET Core from ... https://dotnet.microsoft.com/download/dotnet-core/current/runtime

To run in Windows ...

  • "c:\program files\nextpvr\nscripthelper.exe" -pin:1234 -server:name or IP:port -options

To run in Linux (if NextPVR was installed using the deb installer) ...

  • /opt/dotnet/dotnet /opt/nextpvr/system/NScriptHelper.dll -pin:1234 -server:name or IP:port -options

The value ... 1234 ... should be replaced with the PIN Code set at Settings ... Access

The option ... -pin:1234 ... can be omitted if the Pin Code has the default value of ... 0000.

The ... -server ... option should specify the computer name or IP address and port number for the computer running NextPVR Server. You should specify the NextPVR Server port number as ... 8866 ... unless the port number has been set in config.xml

The option ... -server ... can be omitted if the ... dotnet nscriphelper.dll ... command is running on the same computer as NextPVR Server.

nscripthelper.dll can be moved to another folder and does not need to be in, for Windows, Program Files\NextPVR

Options for nscripthelper ...

-status ... lists the tuner devices available to NextPVR Server and shows any activity on each device. Examples ...

  • dotnet nscripthelper.dll -pin:1234 -server:192.168.1.42:8866 -status
  • dotnet nscripthelper.dll -status

-isrecording ... reports ... RECORDING or NOTRECORDING

-isinuse ... reports ... RECORDING or NOTRECORDING

-pending ... lists pending recordings formatted as xml

-rename ... changes the filename in the NextPVR database for a recording file. Does not change the name of the file on disk. Example ...

  • dotnet nscripthelper.dll -rename "C:\TV\The Golden Girls\Season 01\The.Golden.Girls.S01E12.ts" "C:\TV\The Golden Girls\Season 01\The.Golden.Girls.S01E12.AFTER.RENAME.ts" ... updates the database but does not rename the recording file on disk.

-updateepg ... tells NextPVR Server to update the EPG ... equivalent to clicking the Update EPG button.

Reboot Windows Script

As an example of ... nscripthelper ... in use, a Windows computer can be rebooted after an EPG update if a script is stored as ... PostUpdateEPG.bat ...

echo off
REM Reboot if not recording
cd C:"\Program Files\NextPVR"
set NSHelper=NScriptHelper.exe -isinuse -pin:xxxx

:check
FOR /F "tokens=*" %%i in ('%NSHelper% -isinuse') do SET condition=%%i
echo %condition%
IF %condition% =="NOT RECORDING" goto reboot

:delay
timeout 60
goto check

:reboot
echo "About to reboot"
shutdown /r

Thanks to HarryH3 and others for help with this wiki.

⚠️ **GitHub.com Fallback** ⚠️