Simple movie.nfo file creation

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Simple movie.nfo file creation

Post by VAlexiou » 26 Oct 2018, 13:08

Hi all,

I have quite an extensive movie library (>6000) and lately I had to rescan my whole library to Kodi. The Kodi scrapers do not work very efficiently any more - about 10% of my movies are not recognized. The only way to scrape these movies is to create a movie.nfo file in each movie's folder which contains only one line - The IMDB URL.

I have no experience in scripting and although I tried everything I could following this link viewtopic.php?t=501 I had no success, since it is an old thread.

Can anybody help ? I need a script to create a movie.nfo in each movie's folder (if it doesn't have one) with only one line : the IMDB URL of the specific movie.

Thanx for your help

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 27 Oct 2018, 04:29

This should do the trick:
viewtopic.php?t=5
:idea: Please read the FAQ and How to Request Help.

VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Re: Simple movie.nfo file creation

Post by VAlexiou » 27 Oct 2018, 09:22

I've tried the script you mentioned and it works fine. The problem is that it creates a full (all metadata) nfo file plus it downloads all available artwork. I've found that it is a lot better to let Kodi handle all that, so it can updated and managed through Kodi later. I only need the nfo file (movie.nfo) to do one thing - match the movie to the correct IMDB ID and then let Kodi handle all the rest. So it should only have one line - the IMDB url like this

Code: Select all

https://www.imdb.com/title/tt1781058/?ref_=fn_al_tt_1
Since I don't know how to modify the artwork.tmdb script to achieve that , can you please help?

Thanx...

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 27 Oct 2018, 10:13

Sorry, the artwork script doesn't have an option for that. If you just want to generate url / nfo files, then you'd have to write a custom script from scratch for that.

That being said, are you sure that Kodi doesn't work well with well-named files? What file and folder structure do you have? You should have no problem if you process all your files through FileBot with the {plex} format:
viewtopic.php?f=5&t=4116
:idea: Please read the FAQ and How to Request Help.

VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Re: Simple movie.nfo file creation

Post by VAlexiou » 27 Oct 2018, 11:34

Thanks you for your prompt response.
As I mentioned in my first post I tried some of the solutions posted in this thread viewtopic.php?t=501
I guess the following piece of code - which was suggested by you

Code: Select all

args.getFiles{ it.extension == 'nfo' }.each{ nfo ->
	def xml = nfo.text.xml
	['imdb', 'tmdb'].each{ db ->
		def url = xml."$db".text()
		if (url) {
			def urlFile = new File(nfo.dir, "${db}.url")
			def content = "[InternetShortcut]\nURL=${url}\n"
			println content.saveAs(urlFile)
		}
	}
}
should do the job nicely, but when I try to run it I get the following

Code: Select all

C:\>filebot -script nfo.groovy "W:\fbTest"
Done ?(?????)?

C:\>
but doesn't create any nfo files.

So I guess what I am asking is if you could modify it to make it work ...

Thanx again for your help...

P.S. Kodi works fine with well name metadata files, but it is difficult to modify or update anything especially all the metadata in a regular movie.nfo. So what I am trying to achieve is to utilize the movie.nfo file to "match" the movie to the IMDB ID and create everything else through Kodi. My folder structure is the standard, i.e each movie and TV series in its own folder and each TV series season in its own subfolder.

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 27 Oct 2018, 15:45

The code above assumes that you already have *.nfo files with imdb / tmdb ids and then just generates additional url files, which means it assumes that you already ran the artwork script to generate the nfo files, which already did the heavy lifting of looking at the file path, and matching it to a movie entry in the database, and thus being able to know the IMDb / TMDb ID.

The Name (Year) file / folder name standard, e.g. Avatar (2009), is usually a unique identifier just as good as the IMDb / TMDb ID.

So you're file paths look like this, and Kodi still can't deal with it?

Code: Select all

Movies/Avatar (2009)/Avatar (2009)

Code: Select all

TV Shows/Alias/Season 01/Alias - S01E01 - Truth Be Told
:idea: Please read the FAQ and How to Request Help.

VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Re: Simple movie.nfo file creation

Post by VAlexiou » 27 Oct 2018, 17:24

Exactly ... And yet Kodi scraper misses about 10% of the titles !

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 28 Oct 2018, 13:45

Re: Custom Scripting Services

Sure. Please post a few example file paths so that I have something to test with, especially examples for the 10% that don't just work. Feel free to continue this on the public thread.

Note that custom scripts are no less than 30 EUR, unless you have a life-time license, then you'll get an easy one for free. ;)
:idea: Please read the FAQ and How to Request Help.

M7URT
Posts: 3
Joined: 27 Sep 2018, 07:38

Re: Simple movie.nfo file creation

Post by M7URT » 28 Oct 2018, 23:28

The reason it misses shows, I believe, is that filebot is using API1 of the TVDB and not the newer API2. it really messes things up since KODI deprecated it

VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Re: Simple movie.nfo file creation

Post by VAlexiou » 29 Oct 2018, 11:44

Please see below some examples of actual movie paths that don't get scraped, including 3D movies :

Code: Select all

W:\HD Movies\Ant-Man (2015) 3DBD 3D SBS\Ant-Man (2015).3DBD.3D.SBS.mkv
W:\HD Movies\Baby Driver (2017)\Baby.Driver.2017.1080p.BluRay.REMUX.AVC.DTS-HD.MA.5.1-FGT.mkv
W:\HD Movies\Ben-Hur (2016)\Ben-Hur (2016).mkv
W:\HD Movies\Avatar (2009) 3DBD 3D SBS\Avatar (2009).3DBD.3D.SBS.mkv
As you can see at some point I changed the naming convention of my movie files to include the release details.

From the tests I performed I found out that if there is a movie.nfo file in each movie folder that contains a single line with the IMDB url e.g. :

Code: Select all

https://www.imdb.com/title/tt5095030/?ref_=nv_sr_1
or
https://www.imdb.com/title/tt3890160/?ref_=nv_sr_1
or
https://www.imdb.com/title/tt2638144/?ref_=nv_sr_2
or
https://www.imdb.com/title/tt0499549/?ref_=nv_sr_2 respectively
the scraper works perfectly.

Thanx for help ....

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 29 Oct 2018, 13:58

M7URT wrote:
28 Oct 2018, 23:28
The reason it misses shows, I believe, is that filebot is using API1 of the TVDB and not the newer API2. it really messes things up since KODI deprecated it
FileBot 4.8.2 and up use the new JSON API, so this shouldn't be it.
:idea: Please read the FAQ and How to Request Help.

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 29 Oct 2018, 14:02

VAlexiou wrote:
29 Oct 2018, 11:44
As you can see at some point I changed the naming convention of my movie files to include the release details.
I see. You're not using {plex} but a custom format, which means may or may not work and all bets are off. Using IMDb link files may indeed be your best option then.

:?: Please run filebot -script fn:sysinfo and post the output so we can see what version you're running.

:?: Did you already process all files with FileBot? Can we assume that all files are already xattr tagged? (see viewtopic.php?f=3&t=324)
:idea: Please read the FAQ and How to Request Help.

VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Re: Simple movie.nfo file creation

Post by VAlexiou » 29 Oct 2018, 14:24

Here it is

Code: Select all

C:\WINDOWS\system32>filebot -script fn:sysinfo
FileBot 4.8.4 (r5829)
JNA Native: 5.2.2
MediaInfo: 18.05
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2018-10-05 (r536)
Groovy: 2.5.1
JRE: Java(TM) SE Runtime Environment 10.0.2
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 32 Core / 15 GB Max Memory / 38 MB Used Memory
OS: Windows 10 (amd64)
Package: APPX
License: Microsoft Store License
Done ?(?????)?
What do you mean by a custom format? At some point I changed the movie file naming format from "Movie Name (Year)" to "Movie.Name.Year.Release.Details.mkv" because I found it easier to get the correct subtitle (at a later stage) when I have the release details. So older movies use the first naming convention and newer ones the second. In any case it is not that Kodi scrapes only one or the other naming format. It misses 10% of both types of naming formats, and afaik Kodi uses the folder names to scrape movies.

I only use filebot to fetch subtitles for Movies and TV Shows. It only scans media files that have been added in the last 10 days. It runs as recurring task on a Synology NAS, where all my files are stored. I don't do ANY processing with Filebot.

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 29 Oct 2018, 14:32

VAlexiou wrote:
29 Oct 2018, 14:24
I only use filebot to fetch subtitles for Movies and TV Shows. It only scans media files that have been added in the last 10 days. It runs as recurring task on a Synology NAS, where all my files are stored. I don't do ANY processing with Filebot.
That means that IMDb ID is not readily available via xattr, which makes the custom scripting task more tricky / expensive. I can try to copy / paste / butcher together something from the artwork scripts though, assuming that you can confirm that the artwork script worked well in your tests so far. Does 30 EUR sound reasonable?
:idea: Please read the FAQ and How to Request Help.

VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Re: Simple movie.nfo file creation

Post by VAlexiou » 29 Oct 2018, 14:33

Sure ...

User avatar
rednoah
The Source
Posts: 16812
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Simple movie.nfo file creation

Post by rednoah » 29 Oct 2018, 14:36

Alright. I'll look into it tomorrow.
:idea: Please read the FAQ and How to Request Help.

VAlexiou
Posts: 8
Joined: 26 Oct 2018, 12:45

Re: Simple movie.nfo file creation

Post by VAlexiou » 29 Oct 2018, 14:50

OK. Thanks a lot ....

Post Reply