Integrating NextPVR Recordings into Main Library

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
pkscout Offline
Posting Freak
Posts: 1,045
Joined: Jan 2011
Reputation: 22
Location: Honolulu, HI
Post: #1
I've been using ArgustTV for quite awhile (until the recording system imploded after a reboot and couldn't talk to the tuners anymore). I just switched to NextPVR, and one of the things I really wanted to have back was a way to integrate NextPVR recordings into the main library the way I did with ArgusTV.

It took little doing, but I found a solution that seems to work well, so I thought I'd share.

1- Adding Recording Directories to NextPVR/XBMC
I added a TV Shows directory and Movies directory to NPVR. I then added those two directories as sources in XBMC. Now when I schedule a recording, I tell it in which directory to place the recording.

2- Renaming Files
NextPVR files aren't named in a format XBMC understands. I found a utility called imageGrabLite that will rename those files during post processing:

http://www.gbpvr.com/nwiki/pmwiki.php?n=...geGrabLite

3- Triggering an XBMC Scan
This one ended up being the trickiest, as I could never get a curl call to work during post processing that would trigger a library update just on the directory in which the finished recording resided. So what one line of batch code couldn't do, 100 or so lines of python code did. Wink

https://github.com/pkscout/trigger.xbmcs...master.zip

There's a read me file with the script that will explain how to install it and use it. It does require python 2.7.x or later and the requests module. The script has some additional renaming options for some problematic files (mostly local and national news).

Lastly, here's my NPVR PostProcessing.bat file with the imageGrabLite commands that seem to generate the most success.
Code:
rem calls imageGrabLite, which renames file to XBMC standard
"C:\Program Files\NPVR\imageGrabLite.exe" --oid %3 --rename --zap2it
rem use python script to generate JSON call to have XBMC update the library from directory of the just converted file
"C:\Python27\python.exe" "C:\CustomApps\trigger.xbmcscan\default.py" %1

I hope someone else finds this useful.
find quote
emveepee Offline
Senior Member
Posts: 293
Joined: Jul 2012
Reputation: 0
Post: #2
I would suggest adding this rule to advancedsettings.xml

Code:
<tvshowmatching action="prepend">
      <regexp>[\\/\._ -](20[0-9]{6})_.+\.ts</regexp>  <!-- Match NextPVR date as a season -->
</tvshowmatching>
to allow general shows to be scanned without renaming.

Martin
(This post was last modified: 2014-05-18 20:15 by emveepee.)
find quote
pkscout Offline
Posting Freak
Posts: 1,045
Joined: Jan 2011
Reputation: 22
Location: Honolulu, HI
Post: #3
On the off chance anyone downloaded the script in the last few hours, you might want to download it again. The script will now take a json file (see readme.txt for format) that has a list of episodes and use the information to rename files using the show.SxxExx.title.ext format. I added this because it looks like imageGrabLite can't find shows on thetvdb.com if the episode doesn't have a title *and* the air date on thetvdb.com doesn't match the record date. In the Flesh on BBC America happens to fall into this category.
(This post was last modified: 2014-05-18 21:30 by pkscout.)
find quote
donbrew Offline
Junior Member
Posts: 19
Joined: Oct 2013
Reputation: 0
Post: #4
Why not just use the Watchdog add-on? Did I miss something?
find quote
pkscout Offline
Posting Freak
Posts: 1,045
Joined: Jan 2011
Reputation: 22
Location: Honolulu, HI
Post: #5
I started with that, but it appeared watchdog was doing a complete library update rather than just updating the directory where the new file was. Watchdog also seemed to trigger when a new recording file was created, and since the file never has the right name until after imageGrabLite runs, nothing got into the library.

Plus, I had to do some post work on certain files imageGrabLite couldn't handle, so I just built it into one script.
find quote