Overview

VidImport allows you to add (or restore existing NPVR/GBPVR) video files to the NPVR/GBPVR database so they show up on the recordings screen in an intelligent manner (ie grouped) as it does this it does a quick IMDB/TVRage lookup to try to get more information on the file for display. These files may be files that you downloaded or previous N/GBPVR recordings that somehow were deleted from the N/GBPVR recordings database. If using with NPVR you need to manually import the recordings XML file created by vidImport.

  • VidImport either takes as the first argument a single file or a directory. If a directory it searches for video files (.mpeg, .mpg, .avi. .mpv, .ts, .mp4, dvr-ms) recursing to the lowest level. Either way it creates an xml file that gbpvr can import.
  • Vidimport tries to intelligently use the directory name and any filename similarities and any season/episode syntax to create the titles and subtitles so files are grouped in a useful manner by GBPVR/PVRx2.
  • If files are in a syntax that looks something like battlestarGalactica.s04e01.avi. It will create a GBPVR group (not in NPVR) called BattlestarGalactica with the episodes underneath. It then does a tvRage lookup for an episode title and description which it adds as well. The episodes will list in GBPVR as something like "s04e01:the one with a rock"
  • Vidimport will also look for a hidden NPVR/GBPVR metadata file. If this exists it will use the description, title and other information found within.
  • Vidimport will also make an attempt at an IMDB lookup for a description if it imdb lookup is set to on and the file is not detected as a having series syntax as above.
  • Vidimport can also generate an .nfo file for each video file that is recognize by XBMC (as a tv episode). Useful for users of myGbpvr XBMC scripts.
  • If the 'xlmin=' switch is NOT set to NONE it will look in the GPBVR directory and read the recordings-dump.xml file (which contains a text export of the gbpvr recordings database) it will read that file and use it to avoid creating duplicate recordings.
  • Finally, vidImport will launch pvrx2 with the import argument using the file created causing GBPVR to import the recordings in this file. (note: GBPVR deletes the file that vidImport creates when it performs the import.) (Note: NPVR will not autoimport so you must have vidImport create an output file and manually import it via settings/recordings.)

So why use vidImport? First and foremost when your gbpvr.db3 is corrupted or lost and you didn't back it up.
Second, if you have a big video library from elsewhere and the lack of grouping and descriptions in the video library function annoy you.
Third, if you don't like having to look both in the recordings plugin and the video library plugin to find all your videos.
Fourth, if you download video files after each download you can simply drag the file onto vidImport and it will be imported into NPVR/GBPVR's database with an IMDB/TVRage/TheTVDb.com description. If the "seriesOnly" switch is used then if a file has the syntax "seriesTitle.episodeTitle" it will use the episode title for the lookup and add the season episode string if it can.
Fifth, if you download series or copy series from another computer. If the series uses a series_names.s01e05. VidImport will put in NPVR/GBPVR with a top name of series_name.s01 and sub names of e5:episode_title. It will also add a description if found on the internet.

Usage

vidImport.exe <top directory | file to be imported> [outfile] [imdb=on|off] [import=on|off] [xmlin="gbpvr/npvr recordings export file|none"]
top directory = the directory you want scanned or the single file you want imported. Required.
outfile = name of the file you want the xml to be created in. Optional, defaults to videos.xml.
imdb=on|off = do you want imdb lookups on files with no metadata. Optional, defaults to on.
xmlin= vidImport will automatically read in the recordings-dump.xml file found in the NPVR/GBPVR install directory. If you want vidImport to read a different gbpvr export file specify it here or specify "none" if you want vidImport to ignore that file. vidImport will ignore any files that are in the dump avoiding duplicate recordings in the database. Optional, defaults to (GBPVR install dir)\recordings-dump.xml.
xmlout= If import is off this is the file name vidImport will use to write its xml output.
import=on|off if import is set to on vidImport will as its final step run pvrx2.exe -import with the file it created causing an immediate import of all file descriptions to the npvr/gbpvr database (this can also be manually be done on the config.exe plugin page). This will cause the xml file that vidImport created to be deleted so run NPVR/GBPVR to check the results. Optional, defaults to on.
will cause the xml file that vidImport created to be deleted so run NPVR/GBPVR to check the results. Optional, defaults to on.
showfile="" = Allows you to specify a filename to read/write the showfile. Optional, defaults to "showfile.text in the vidimport directory".
sprefix="" = Text before the season #. Optional, defaults to "s".
eprefix="" = Text before the episode #. Optional, defaults to ".e".
esuffix="" = Text after the episode #. Optional, defaults to ".".
useFileNameTime = Causes vidImport to use the timestamp embedded in a gbpvr filename as the highest priority time even if metadata exists. Optional, defaults to false.
seriesonly = Causes vidimport to assume everything is a series and if a filename contains a "." then it is assumed to be "title.subtitle" and does a lookup using the subtitle.
nfo=on|off"" = Causes vidimport to generate an xbmc .nfo file for every video file. Defaults to off.
writeMetadataXml"" = If the file has gbpvr or npvr metadata will write a <filename>.xml file with that metadata.
gui = Causes vidimport to display a gui with all parameters plus a few over-ride options.

Since the first argument is the directory or filename you want imported and all else defaults to GBPVRs standards you can drag and drop onto vidImport and it should do the right thing.

Behavior

This depends on what the directory structure and file names look like.

Type 1: A directory with files of gbpvr syntax.
I.E. A directory called Bloodrayne with the files bloodrayne_20080601_1200_1230 and bloodrayne_2080607_1200_1230. VidImport will create recordings with the title bloodrayne. GBPVR will group them and they will be denoted by date. If the recordings have GBPVR metadata files vidImport will use that data as well.

Type 2: A directory with similarly named files (where more than the first 3 characters the same) but not GBPVR nomenclature.
I.E. A directory called movies with the files bloodrayne_cd1 and bloodrayne_cd2. VidImport will compare the titles and split at the point where they begin to differ. In this case "bloodrayne_". It will then create recordings with the first part of the split as the title and the second parts as a subtitle. IE Title: "bloodrayne_", subtitle "cd1" and "cd2"

Type 3: A directory with files not named alike and not in GBPVR syntax.
I.E. A directory called hyperdrive with the files "the one about hair", "dont come back" vidImport will create 2 recordings with the title "hyperdrive" and subtitle of the individual filenames.

Type 4: A directory with files named alike with a series syntax (such as .s01e04. -s1x4- -401- _s01x04_ ) within
I.E. A directory called scifi with the files "blakes7.s1e3.whosThere", "blakes7.s1e5.imThere" vidImport will create 2 recordings with the title "blakes7" and subtitles of the "s1e3.whosThere", "s1e5.imThere". Single or double digit episode numbers are acceptable.

Type 5: A directory with a mix of the above
vidImport will follow the rules that make the most sense as above. So if two files are named similarly it will split the file names as above. If another two have no similarity it will use the directory for the title and filename as the subtitle.

IMDB Lookup & TVrage Lookup If the syntax of the file matches a season syntax vidImport will use TVRage or theTVDB.com to lookup episode info. Otherwise, vidImport will lookup both the subtitle and title on IMDB. If it finds both it will use the subtitles description. This makes it good for movies or series that are in NPVR/GBPVR or other series syntax but bad for series in another syntax since it will often find a movie description close to the episode title and use that.

Warning vidImport does not have a whole lot of error handling YMMV. Not sure how well it will work with non-english language filenames.

Download :

Download:vidImport.zip (1048 downloads)

Requires Microsoft .NET Framework 3.5.

Version(s) / History

1.71 12/02/2012 - If using file creation time exports utc time
1.70 12/01/2012 - Fixed ability via autoImport parm for vidImport to call npvr with import args
1.60 04/01/2012 - Add ability via autoImport parm for vidImport to call npvr with import args
1.50 12/29/2010 - Add switch "useFileNameTime" to over-ride us of metadata time if wanted with GBPVR syntatx files
1.49 12/26/2010 - Minor fix on times generated for gbpvr syntax files.
1.48 11/21/2010 - Made fix due to IMDB change causing movie lookups to fail.
1.47 11/20/2010 - Adds seriesOnly option which allows lookup based on "title.subtitle" syntax
1.43 10/24/2010 - Reads correct alternate stream "metadata.xml" if there are multiple alternate streams 1.41 10/03/2010 - Reads location of NPVR or GBPVR database. Will extract metadata into .xml file (only gbpvr metadata at this time)
1.36 5/31/2010 - Added gui.
1.35 5/30/2010 - Added dixv, ifo and mov as valid extensions.
1.34 4/7/2010 - Improved selection of series for TvRage, added parsing of year in filename allowing easier lookup of series that have ran more than once. To use this simply put the year of the run or even the original airing of the episode in the name in parans e.g. Battlestar Galactica (2005).
1.33 4/5/2010 - Add lookup for registry key that contains the GBPVR path for x64 machines. Add new NFO switch which causes vidImport to generate a .nfo file that XBMC can read.
1.32 8/28/2009 - Minor fixes when filenames don't match.
1.27 4/20/2009 - Changed so that series are in a single directory and the episode subtitle starts with the series string s04e01 to better match with gbpvr and guidePlus.
1.26 4/12/2009 - Fixed a bug with duplicate entries.
1.2 1/21/2009 - Fixed a bug with duplicate recordings.
1.1 11/29/2008 - Changed the showfile to save as showDetail.txt in the gbpvr dir. Uses the same showfile as guidePlus.exe utility.
1.0 11/26/2008 - Changed TVRage (thanks rage!) to use XML where possible. Save a showfile.txt of cancelled shows to save bandwidth. Added new args to allow custom season and episode prefix/suffix. Also improved IMDB lookup in a few spots.
.99 10/17/2008 - Added series lookup and significantly cleaned up series detection and naming. Also improved IMDB lookup in a few spots.
.93 7/12/2008 - Fixed some issues with command line
.92 6/24/2008 - Minor bug fix with episode detection and naming
.9 6/23/2008 - Reads the GBPVR install dir to get the recordings-dump.xml location. Also runs pvrx2.exe -import at the end autoimporting files.
.8 6/13/2008 - Significantly improved series detection. Added dvr-ms and dvrms as extensions it searches for.
.7 6/12/2008 - Now looks for a hidden metadata file from GBPVR. If it exists it populates the recording data with that info. Also does not do imdb lookup on subtitles on files that are id'd as series it will use the title only.
.6 6/11/2008 - Added ability to try IMDB lookup - made GBPVR syntax detection more robust
.5 6/10/2008 - First Version (beta)

Possible ToDo's

  • If creating metadata - add that metadata to the file or as a separate file

Author(s)

carpeVideo


Category:Utility

Page last modified on December 02, 2012, at 03:39 PM