Failed to grep IMDbID

Any questions? Need some help?
Post Reply
parisbyday
Posts: 3
Joined: 04 Sep 2013, 07:24

Failed to grep IMDbID

Post by parisbyday »

Hello,

Sorry but i am a beginner with filebot.

I started using filebot from a synology and i want to cleanup/rename my movie files already organized with nfo generated by application like couchpotato in the xbmc format.
when i run the following cli :
filebot -rename * --format "{y}/{n} {fn} ({y})" --action test --db TheMovieDB --log-file filebot.log -non-strict
I got the following error :

DiskStation> filebot -rename * --format "{y}/{n} {fn} ({y})" --action test --db TheMovieDB --log-file filebot.log -non-strict
Locking /usr/local/filebot/data/logs/filebot.log
Rename movies using [TheMovieDB]
Failed to grep IMDbID: Body of Lies (2008).nfo

It seems the imdbid is not extracted even it if is present in the nfo file :
<id>758774</id>

How can make filebot extract properly this info ? do i need a script and if yes does this script already exist ?
Also since all my nfo are clean since created from XBMC, i dont need necessarly to query TheMovieDB again.
Can i rename my file using info already present in the nfo ?

Many thanks in advance for any guidance,

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

Re: Failed to grep IMDbID

Post by rednoah »

IMDb is supposed to be formatted like this: tt0758774, are u sure it's the IMDb and not the TMDb ID? What tool created the .nfo files?

FileBot works with the official specification:
http://wiki.xbmc.org/index.php?title=NF ... g_XML_data

FileBot will always check with TMDb and rename/generate new .nfo files based on that. It's only using .nfo files to help with lookup, so at most it's reading IMDb/TMDb IDs. But it'll also work if you don't have proper or any .nfo files, just well-named files will work perfectly fine.
:idea: Please read the FAQ and How to Request Help.
parisbyday
Posts: 3
Joined: 04 Sep 2013, 07:24

Re: Failed to grep IMDbID

Post by parisbyday »

Hello,

Thanks for the quick reply.
Most of time i do an export from XBMC database to generate consistent nfo.
XBMC will create clean nfo with all detailled info.
Unfortunately, it seems that in this export process, XBMC forget the prefix tt in front of the IMDB id. I just manually added it to check and it worked.
Any idea on how to fix this ?
could be a script in filebot to add tt before the query or change XBMC behaviour in the export process...

Thanks in advance,
Jean.
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to grep IMDbID

Post by rednoah »

It'd be very very easy to make a script for that.

On Linux I wouldn't even bother, just do something like this:
http://stackoverflow.com/questions/7536 ... x-terminal
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to grep IMDbID

Post by rednoah »

Here's my script for this:

Code: Select all

args.getFiles{ f -> f.extension == 'nfo' }.each{ f ->
	f.text.replaceAll('<id>(\\d+)</id>', { m, id -> "<id>tt${id.pad(7)}</id>"}).saveAs(f)
	
	// log nfo path and new content
	println f
	println f.text
}
:idea: Please read the FAQ and How to Request Help.
parisbyday
Posts: 3
Joined: 04 Sep 2013, 07:24

Re: Failed to grep IMDbID

Post by parisbyday »

Works perfectly as expected. Used a find to process all nfo's recursively
find . -name \*.nfo -exec filebot -script ren.groovy {} \;

Many thanks again for your time.

JEan.
Post Reply