NextPVR Forums

Full Version: NPVR to XBMC File Renaming Utility
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm releasing a utility I created to rename files recorded from NPVR to a format supported by XBMC. It works by scraping the required information from TheTvDB and TheMovieDB. It was designed specifically to work with Zap2It based EPGs such as Schedules Direct or the Microsoft EPG. I'm not sure how well it will work with other types of EPGs. So far it's only been tested against the Microsoft EPG.

It doesn't require an exact match in order for the file renaming to occur. It will try its best to rename the file using fuzzy matching. In some cases it's possible this behavior may cause an incorrect match but I haven't run into any mismatches lately. If a match can't be found it will create NFO files.

Installation:

Note: .net framework 4.5 required

1. Extract the files from the archive and copy them all to c:\pvrscraper\.
2. Edit PvrScraper.exe.config and set the npvrDbPath, xbmcTvPath, and xbmcMoviePath variables to suit your own needs.
[INDENT]a. npvrDbPath - the location of your NPVR SQLite database, usually c:\users\public\npvr\npvr.db3[/INDENT]
[INDENT]b. xbmcTvPath - the folder containing tv shows that XBMC reads from. PvrScraper will move the files to this folder during the renaming process.[/INDENT]
[INDENT]c. xbmcMoviePath - the folder containing movies that XBMC reads from. PvrScaper will move the files to this folder during the renaming process. [/INDENT]

Usage:

Running for a specific OID:
pvrscraper.exe oid <insert oid here>

Re-running for recordings that have failed to match in the past:
pvrscraper.exe failed

Recommended Batch Files:

PostProcessing.bat
"c:\pvrscraper\pvrscraper.exe" oid %3

PostUpdateEPG.bat
"c:\pvrscraper\pvrscraper.exe" failed
How does this utility handle shows with no matches? I record our local and national news, and since I use XBMC as my only front end, I would like to have those show up as S0x files with the date as the file name. In theory ImageGrabLite does this, but it doesn't always work for me. I wrote a little python script to handle the stuff ImageGrabLite has a problem with, but if this utility handles no match files well I may look at it.
pkscout Wrote:How does this utility handle shows with no matches? I record our local and national news, and since I use XBMC as my only front end, I would like to have those show up as S0x files with the date as the file name. In theory ImageGrabLite does this, but it doesn't always work for me. I wrote a little python script to handle the stuff ImageGrabLite has a problem with, but if this utility handles no match files well I may look at it.

Currently it's renaming failed TV shows to this format:

TvShowName.yyyy.MM.dd.HHmmssff.ts. It creates an NFO file with the subtitle as the name, if a subtitle exists. If not then it uses the date as the name. This causes them to show up as season -1 in xbmc

Is that what you are wanting?
Downloaded and started using your nifty little utility for a week or so now and it works well (two thumbs up!) Do have one request for you, can build a process to call another batch post processing file and output a parameter with the path\filename of the new file so that I can then pass it on to the next program in my batch stream to run videoredo to build a project that I then use to verify cuts and strip out commercials? Either that or output in the log file the destination path as well and I can then parse the log to get the path & filename?
cfs123 Wrote:Downloaded and started using your nifty little utility for a week or so now and it works well (two thumbs up!) Do have one request for you, can build a process to call another batch post processing file and output a parameter with the path\filename of the new file so that I can then pass it on to the next program in my batch stream to run videoredo to build a project that I then use to verify cuts and strip out commercials? Either that or output in the log file the destination path as well and I can then parse the log to get the path & filename?

Thanks for the feedback. I'll try to look into this and see how feasible it would be.
Update: uploaded a new version to fix an encoding bug that could cause some characters to display incorrectly.
I like this utility, but can you change it to rename all files with the same title name, such as my comskip txt files?