Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Determine Server Tuner/Recorder Status from Console App

  1. #1
    Join Date
    May 2009
    Location
    USA, West Michigan
    Posts
    11

    Question Determine Server Tuner/Recorder Status from Console App

    I'm trying to programmatically determine if anything is currently being recorded by NPVR from an external console app. I can probably deduce it by looking at the Scheduled Recordings in the NPVR db, but is there an easier method? Link to docs, sample code?
    Last edited by 27InchSony; 2016-10-13 at 02:10 AM.

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,155
    You can run "NScriptHelper.exe -isinuse" or "NScriptHelper.exe -isrecording" or "NScriptHelper.exe -now". Each does slightly different things.

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,155
    The nextpvr .net plugin API is available to console apps too. You can get status via http .

    Martin.

  4. #4
    Join Date
    May 2009
    Location
    USA, West Michigan
    Posts
    11

    Lightbulb

    From sub's recommendation......how part of the NScriptHelper.exe code works:

    Code:
    string serverStatus = NShared.RecordingServiceProxy.GetInstance().GetServerStatus();
    if (serverStatus.ToLower().Contains("recording") || serverStatus.ToLower().Contains("livetv"))
    {
    	//hey things are recording!
    }
    Last edited by 27InchSony; 2016-10-13 at 02:11 AM.

  5. #5
    Join Date
    Jul 2016
    Location
    USA
    Posts
    40
    Is there documentation somewhere for NscriptHelper.exe? I searched the wiki and found nothing.

  6. #6
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,155

  7. #7
    Join Date
    Jul 2016
    Location
    USA
    Posts
    40
    hmm, I was kind of hoping it would be able to start/stop a recording from the command line. Is there any way to do that with NextPVR? Or perhaps some other kind of utility that would work with a DRI device or Network Recorder device?

  8. #8
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,155
    No - that sort of stuff is built into the user interface for the app.

    What are you trying to do exactly? Why do you require this type of functionality from the command line?

  9. #9
    Join Date
    Jul 2016
    Location
    USA
    Posts
    40
    well, for whatever reason, my Ceton seems to have a problem when coming from Sleep, the first attempt to record fails because CableCARD has a bad channel list or something. Every record attempt after that is fine. But if I have 3 shows recording, then the one of the three always fails (whichever is attempted first I guess). So I wanted to make Wakeup.bat do a fake attempt to record to fix the problem.

    And maybe by "fail" I should say NextPVR is oblivious that anything is wrong, it's simply the frequency is set wrong so there's no data sent. looking at channels when it happens, the frequency is wrong, and the program data is blank. (see pic)



    but anyway that's why I want to do that, to just poke the card to make sure it's fully working. I guess i'll have to write my own if I can find some docs on DRI/Network recorder APIs.

  10. #10
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,155
    Like I wrote earlier you can create a console .net app to do pretty anything. Probably the best source for this is to see how NEWA manages it.

    Using sockets from the console you can also use sub's web XML api self documented in Kodi https://github.com/kodi-pvr/pvr.next...nt-nextpvr.cpp or in NEWA's excellent well documented JSON web service. http://localhost:8866/api

    To tune and record in batch file you could just use something like curl to capture a short live stream using curl or wget and then killing the task after a few seconds. Once streaming stops NextPVR will eventually cancel the recording on The syntax for a live tv url is http://localhost:8866/live?channel=## so in pseudo code it would be

    start wget url -O nul
    sleep 5
    taskkill /IM wget.exe /f

    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •