Author Topic: automatic MovieImport with .nfo-File  (Read 4103 times)

0 Members and 1 Guest are viewing this topic.

Offline layerbreak

  • Member
  • *
  • Posts: 8
    • View Profile
automatic MovieImport with .nfo-File
« on: April 05, 2013, 08:36:24 pm »
Hello all,
I am using XBMC to view my video collection but I have managed the videos before with PVD. For XBMC I have needed weeks to
My folder/file-structure is:
Folder: "Videoname_ttxxxxxxx(from IMDB)_(YYYY)"
Files:Videoname.ext, Videoname-poster.jpg and Videoname.nfo

The nfo-file have all information inside about the movie. Here a example of the xml-stucture.

Is there a way to scan the folders automatically and import the movie-informations by reading the nfo-File and import the jpg?
Who can help me please?

Thx.

Offline layerbreak

  • Member
  • *
  • Posts: 8
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #1 on: April 08, 2013, 04:19:05 pm »
Pity, nobody can help me.  ???

Maybe a other way who can help me someone.

My Folder-Structure ist:
Video_Title_with_underscore_tt1234567(IMDB id)_(ReleaseYear)
When I insert in the FileScanner the RegEx who filter the IMDB ID can that match?
I am not familiar with RegEx. I need here help too.

Could that be a solution?? Can PVD match with the IMDB ID the movie to 100%?

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #2 on: April 11, 2013, 11:32:14 pm »
Quote
Pity, nobody can help me.

Welcome, and sorry you haven't yet found help. Your question is very specific, and that normally increases the chances of getting a good answer. Unfortunately, it also makes is easier for the reader to think, "I don't know," and therefore not respond.

In this case, I can tell you there probably are ways to import XML data, but not directly. I've never found a way to easily convert XML files into a plain text, CSV or XML files that can be imported. If there were a tool that would batch convert the NFOs to the particular TXT format PVD will import (when found "beside" he video file), that, of course, would be a solution.

But it might be better to question your objective. Your original question implies it's important the XBMC produced NFO's be the source of the data. But PVD's primary purpose is provide the tools necessary to gather and maintain the data for a video database. As such, it would normally be the source of data for XBMC, and it seems that might what you actually want to do. If the data in the existing NFO files is the same as what PVD will get anyway (e.g., basic data from IMDb), then there's no need to import that. If there's some personal data (e.g., date viewed, rating), there's probably a more straightforward way to do a one-time export/import of that data using a list.

Quote
Could that be a solution?? Can PVD match with the IMDB ID the movie to 100%?

Yes. Unfortunately, PVD will not use the IMDb tt number to find the movie. (I'm not sure if even the IMDb web interface will.) But with an accurate [Title] and [Year] you should get the correct movie about 90% of the time. That's not bad, since it means a Silent Mode import will get 90% in one go. Each of the remaining 10% with then require a few seconds of your time to resolve whatever the ambiguity is. Even if there's a 100 of them, you'll be done faster than anyone can dream up a better solution.

You describe a file-naming scheme in which [Title] and [Year] would always be found in the folder name, consistently delimited by the "_" (or by the "tt000000" separating them). This should do the trick:

(?i)^.+\\(?P<title>[^\\]+)_tt\d{7}_\((?P<year>(19|20)\d{2})\)

The attached screen shot of Expresso's 'regex analyzer' window shows what this expression means/does.

[attachment deleted by admin]

Offline layerbreak

  • Member
  • *
  • Posts: 8
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #3 on: April 18, 2013, 07:09:42 pm »
Quote
Could that be a solution?? Can PVD match with the IMDB ID the movie to 100%?

Yes. Unfortunately, PVD will not use the IMDb tt number to find the movie. (I'm not sure if even the IMDb web interface will.)

The IMDB webside matche the movie by using the tt number in the search field.

Quote
But with an accurate [Title] and [Year] you should get the correct movie about 90% of the time. That's not bad, since it means a Silent Mode import will get 90% in one go. Each of the remaining 10% with then require a few seconds of your time to resolve whatever the ambiguity is. Even if there's a 100 of them, you'll be done faster than anyone can dream up a better solution.

You describe a file-naming scheme in which [Title] and [Year] would always be found in the folder name, consistently delimited by the "_" (or by the "tt000000" separating them). This should do the trick:

(?i)^.+\\(?P<title>[^\\]+)_tt\d{7}_\((?P<year>(19|20)\d{2})\)

The attached screen shot of Expresso's 'regex analyzer' window shows what this expression means/does.

Hello @rick.ca and thx for responding. I had given up to get an answer.  8)

My problem is that I have not ever the accurate [Title]
e.g.
James_Bond_007_01_James_Bond_jagt_Dr_No_tt0055928_(1962)
the origin title is
Dr. No
But in all my movie folder names the IMDB ID matches to 100%

I insert your regex in FileScanner at first place but my e.g. movie cant match it.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #4 on: April 20, 2013, 01:04:59 am »
Quote
The IMDB website matches the movie by using the tt number in the search field.

So it does. That should provide a workaround. Modify the regex to extract the tt number as <origtitle>. That will be used in the search to return the unique movie. 8)

I was expecting the import to then [Original Title]. It did not. I may be misunderstanding something, but that seems to be a bug in the plugin. Nostra?

Quote
I insert your regex in FileScanner at first place but my e.g. movie cant match it.

Sorry. I was thinking your "_" delimited the terms. It doesn't, and there's a standard 'find and replace' that changes them to spaces anyway. Try this...

(?i)^.+\\(?P<title>[^\\]+)(?P<origtitle>tt\d{7})\ \((?P<year>(19|2\d)\d{2})\)

I haven't tried that in the program, but the PVD Regex Tester suggests it should work (see attached).

Quote
James_Bond_007_01_James_Bond_jagt_Dr_No_tt0055928_(1962)

It's going to put both your titles into [Title], but I see no way around that. At least this way, you can simply edit-out the part you don't want. BTW, if it's not already apparent, [Title] is used for however you wish to refer to the movie (e.g., translated to you own language, the release title in your country, it's 'popular' title, or whichever variation you remember it by). [Original Title] is intended to be the 'official' title, which is why it's better to import that from a reliable source without modification.

[attachment deleted by admin]

Offline layerbreak

  • Member
  • *
  • Posts: 8
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #5 on: April 20, 2013, 07:56:32 pm »
Thx @rick.ca for answering.

Quote
I insert your regex in FileScanner at first place but my e.g. movie cant match it.

Sorry. I was thinking your "_" delimited the terms. It doesn't, and there's a standard 'find and replace' that changes them to spaces anyway. Try this...I haven't tried that in the program, but the PVD Regex Tester suggests it should work (see attached).

OK, first I have renamed all folders and filenames with this super tool antRenamer by replacing the "underscore" with a "space"
e.g.
James_Bond_007_01_James_Bond_jagt_Dr_No_tt0055928_(1962).m2ts
to
James Bond 007 01 James Bond jagt Dr No tt0055928 (1962).m2ts
because I  cant find the solution to replace it in the PVD program.
Then insert your Regex in FileScanner at first place
Quote
(?i)^.+\\(?P<title>[^\\]+)(?P<origtitle>tt\d{7})\ \((?P<year>(19|2\d)\d{2})\)

Now its running perfect and match my movies to 100%.
Thank you very much.

Here I found the Regex Tester for PVD
« Last Edit: April 20, 2013, 08:03:06 pm by layerbreak »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #6 on: April 20, 2013, 11:01:14 pm »
Quote
because I  cant find the solution to replace it in the PVD program.

It's the 'Find and Replace' window at the bottom of the File Scanner configuration. ;)

Glad you got it working.

This may seem to be a 'fringe case', and it does have what might be a more elegant solution. That would be to create a spreadsheet with [Title], [URL] (from the tt number) and [File Path] from a directory listing of video files. The same worksheet might include other personal data (date viewed, rating, etc.) exported from the other application. Once imported, there would be no need for a file scan, and the URL would ensure a 100% accurate import from IMDb.

But this is just one of a number of cases where it would be helpful to have the IMDb tt number saved as a separate field, with a File Scanner variable that will store it and a Web Search variable that will use it (some websites such as TMDb use it as well). As a internal reference, it wouldn't add to what is already done with the URL, but it would be easier to understand as the unique identifier of a movie record. In other words, it wouldn't change the fact is search is no longer required once a valid URL is recorded, but it would be more obvious that's what's happening. At the same time, it would be available for searches of other sites that might use it. In many cases, it could be a handy and reliable reference to external media (eliminating the need to maintain a separate [ID] or media reference).

Offline Nautilus2067

  • User
  • ***
  • Posts: 74
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #7 on: May 14, 2013, 01:55:00 am »
I am writing an .nfo script at the moment. So if you are a little patient....

Offline Nautilus2067

  • User
  • ***
  • Posts: 74
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #8 on: May 15, 2013, 07:25:26 am »
Hi there,

I have attached the first draft of the .nfo Import script. It's far from ready but imports already all given fields and locally saved posters and backdrops. It workes for .nfo files created from MovPicNFO. If you can provide an XBMC .nfo file, I could make the necessary adjustments.

Regards,
Oliver

[attachment deleted by admin]

Offline Nautilus2067

  • User
  • ***
  • Posts: 74
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #9 on: May 15, 2013, 07:35:04 am »
Oh, I have just seen, that you have already posted an XBMC .nfo file. I will take that to make improvements.

Oliver
« Last Edit: May 15, 2013, 02:58:30 pm by Nautilus2067 »

Offline Nautilus2067

  • User
  • ***
  • Posts: 74
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #10 on: May 22, 2013, 08:20:34 pm »
The script for automatic movie import with .nfo file is ready. Look here:

http://www.videodb.info/forum_en/index.php/topic,3359

Offline layerbreak

  • Member
  • *
  • Posts: 8
    • View Profile
Re: automatic MovieImport with .nfo-File
« Reply #11 on: August 14, 2013, 02:36:34 pm »
Hi Nautilus2067,

sorry for the late answer.

First I have downloaded the nfo_de.7z and copied the nfo_de.psf in the PVD\Scripts-Folder.
Restart PVD an at automatic Import I select .NFO file [DE] and movies\0-9

I get no movie-picture for all movies and only one movie the script dont import the movie-informations.
There was a little bug also in the script --> the script imports _only_ one genre and not all others.

Lets check your link:
The script for automatic movie import with .nfo file is ready. Look here:

http://www.videodb.info/forum_en/index.php/topic,3359