Results 1 to 5 of 5

Thread: PostProcessing and PostCancel.bat being triggered but not working

  1. #1
    Join Date
    Oct 2017
    Location
    USA
    Posts
    29

    PostProcessing and PostCancel.bat being triggered but not working

    This seems like the simplest problem, but I'm stumped. After a recording finishes, I want NextPVR to "touch" a URL on my Plex Media Server that will kick off a library update. Plex has a number of URL's that will automatically start a task. In my case, I want NextPVR to visit this web page after a recording completes:

    Code:
    http://[PMS_IP_ADDRESS]:32400/library/sections/29/refresh?X-Plex-Token=YourTokenGoesHere
    (Except the IP, library number, and token are added properly)

    Now that Windows 10 natively has curl available from the command, this should be a piece of cake. I have both a PostProcessing.bat and a PostCancel.bat located in C:\Users\Public\NPVR\Scripts that contain just one line (with the IP and Token info removed of course):

    Code:
    curl http://IP:32400/library/sections/3/refresh?X-Plex-Token=Token
    If I double-click that batch file, Plex updates immediately. And NRecord.log shows that the batch files are seen, and are being run after a recording. But then nothing happens. The Plex library doesn't update. So the command in the file seems to be correct, but it fails when triggered by NextPVR. Here's the line in the log:

    Code:
    2018-08-04 18:00:01.870	[DEBUG][9]	Starting: C:\Users\Public\NPVR\Scripts\PostProcessing.bat "F:\Recordings\TV\Friends\Friends.S03E02.The.One.Where.No.Ones.Ready.ts" 1434 864 29 "Friends"
    Any guesses what I'm doing wrong? I'm kind of sorry to ask, but I feel like I'm making a really obvious mistake that I'm just not noticing.

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    87,299
    You might need to update your batch file to redirect the curel.exe stdout and stderr to a log file, so you can check what's happening.

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    26,448
    Since you are reluctant to post the IP I assume that Plex is not on localhost. In that case can Plex see your recordings on F: Drive?

    Martin

  4. #4
    Join Date
    Oct 2017
    Location
    USA
    Posts
    29
    Quote Originally Posted by mvallevand View Post
    Since you are reluctant to post the IP I assume that Plex is not on localhost. In that case can Plex see your recordings on F: Drive?
    Apologies, I should have just included the IP info. The NextPVR box is at 192.168.2.112, and the Plex box is on 192.168.2.12. They're on the same subnet. The DVR folder is shared out (Windows 10) and allows anonymous access. The Plex box is running Ubuntu and I have the share mounted in /media. I can ssh into Ubuntu and do an ls on the mounted share and see all the recordings. When I do a manual update, it sees everything.

    Re: curl, I'll redirect to a log file with more verbose info later today. Thank you!

  5. #5
    Join Date
    Oct 2017
    Location
    USA
    Posts
    29
    On a whim, I downloaded the Win32 curl directly from https://curl.haxx.se/ (instead of using the version now built into Windows 10) to see if it handled it differently. Go figure, it worked immediately on the first try. I don't know if this was a permissions issue between the service that triggers the batch script and the built-in curl, or something else. But this workaround fixed it, so I'm happily not going to troubleshoot any further. Thanks for your replies!

Posting Permissions

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