Using Original Title from IMDB in 'Foreign' Movie Names

Any questions? Need some help?
Post Reply
merrysharing
Posts: 2
Joined: 23 Jul 2013, 17:59

Using Original Title from IMDB in 'Foreign' Movie Names

Post by merrysharing »

What a wonderful program. I am learning a lot using it so thank you right off the bat to the creator(s).

I am stuck trying to scrape the Original Title from IMDB in order to rename Anime (or non-English) movies. Please feel free to haze me if this should be painfully obvious. I have found some very helpful threads for renaming Anime Episodes as such, but not Movies using IMDB.

Does anyone know a binding reference for the Original Title as it appears on IMDB pages, usually under the English title?

For example I want to name this movie http://www.imdb.com/title/tt0401233/
Appleseed (Appurushîdo) (2004)

Where Appleseed is the name given with {n} by filebot and Appurushido is the Original Title as it appears on IMDB.

Right now I am using two programs in a work-around: Zeeb which gives me the original title per IMDB, then I input {n} ({fn}) ({y}) into filebot which does everything else. However I am now wondering if I read somewhere that it is not possible to scrape the original title when naming movies using the IMDB and filebot. Does anyone know?


PS forgive any silly terminology, I am creating a bit of a Chinese Room with computers at times
User avatar
rednoah
The Source
Posts: 23030
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by rednoah »

Not supported. Can't be bothered to maintain page scrapers.

Though you can use this format hack:

Code: Select all

{net.sourceforge.tuned.XPathUtilities.selectString('''//SPAN[@class='title-extra']''', net.sourceforge.filebot.WebServices.IMDb.parsePage(new URL("http://www.imdb.com/title/$imdbid/"))).match('"(.+)"')}
This took 2h btw. Next time I'll just say no. :P
:idea: Please read the FAQ and How to Request Help.
merrysharing
Posts: 2
Joined: 23 Jul 2013, 17:59

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by merrysharing »

You are truly kind, I really appreciate your help with renaming my non-English movies. If you have no objections may I share this information (with appropriate credits of course) and link to your program at isohunt.com and bakabt.com forums? I know others could benefit from this.

(As an aside, this might be geeky, but your kindness means a lot to me as I injured myself this summer and I am immobile for a while, and this will help get me through :) It's unlikely but if you ever need help with....editing? biology? nursing? send me a PM )
User avatar
rednoah
The Source
Posts: 23030
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by rednoah »

Hope it's not too serious and you're up and running soon!

btw added a helper function. With r1669 and above you can just do this:

Code: Select all

{net.sourceforge.filebot.WebServices.IMDb.scrape(imdbid, '''//SPAN[@class='title-extra']''').match('"(.+)"')}
(obviously this is a hack and not an officially supported binding)

Sure, have fun doing some advertising for me. I suck at that. :mrgreen:
:idea: Please read the FAQ and How to Request Help.
MikeLDN
Posts: 1
Joined: 11 Oct 2013, 16:33

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by MikeLDN »

Hi, just a quick question, I have been braking mi head with this for the last few days and I can't manage to solve the ridle. I'm trying to do this, but ONLY have the title when there is an Alternative. At present this is working, the only thing is that it is STUCK to the main title, there is no space. If I force a space there is always a space, how do I force a space in this specifc query, so if there is an alternative it will also add a space.

This is what I have:

../{n}{net.sourceforge.filebot.WebServices.IMDb.scrape(imdbid, '''//SPAN[@class='title-extra']''').match('"(.+)"')}({y}){" [${fn.match(/3D/)}]"}{[sdhd]}{' ['+fn.replaceAll(/(?i)directors|theatrical/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT/).join('][').upperInitial().lowerTrail()+']'}/{movie} {" [${fn.match(/3D/)}]"}{[sdhd]}{[source]}{' ['+fn.replaceAll(/(?i)directors|theatrical/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT/).join('][').upperInitial().lowerTrail()+']'}

And this is what i get:
../The BodyEl cuerpo(2012) [3D][HD]/The Body (2012) [3D][HD].mkv

What I would like is:

../The Body (El cuerpo) (2012) [3D][HD]/The Body (El cuerpo) (2012) [3D][HD].mkv

and if there is NO alternative just the title, but if I force spaces I get:

../Avatar () (2009)/Avatar () (2009)

So there are added spaces and blank bracket..

How can I add Brackets and SPaces ONLY if there is title?

Iv'e tried so many combinations I'm now seeking for help.
User avatar
rednoah
The Source
Posts: 23030
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by rednoah »

That's easy, just put all the info in the same {...} block.

Here's some samples you can play with to get the concept:

This works:

Code: Select all

{' ('+ "PXYZ".match(/XY/)+')'}
Exception unwinds entire {...} block:

Code: Select all

{' ('+ "ABCD".match(/XY/)+')'}
:idea: Please read the FAQ and How to Request Help.
dan_714
Posts: 1
Joined: 10 Apr 2014, 02:28

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by dan_714 »

Apologies for reviving a somewhat old thread, but my issue is so relevant that I thought it warranted it. Until now I have been using a format basically derived from those replies above, and it has been working perfectly.

The format I have used is:

Code: Select all

{n}{' ['+net.sourceforge.filebot.WebServices.IMDb.scrape(imdbid, '''//SPAN[@class='title-extra']''').match('"(.+)"')+']'} ({y}) {"($lang)"}
However today I found that the 'title-extra' part of this is no longer working. Since I haven't changed the code in any way, and it worked fine before, I am assuming something has happened externally to 'break' this. Is there by any chance a fix or a workaround to get this up and running again?

There is an error: BindingException:"imdbid": java.lang.NullPointerException, which I can only assume is the source of the issue, but am clueless as to how to fix - if there even is a solution.

I do realise this isn't formally supported, but I hope there is a solution to get it back up and running.
User avatar
rednoah
The Source
Posts: 23030
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by rednoah »

You are using the IMDb scraper for matching files right? Because if you're using TheMovieDB then {imdbid} won't be available.

The IMDb site you see is not necessary the same as IMDb filebot sees due to IMDb handling localization on the server-side. Use Fiddler to see the html pages that filebot gets back.

This definitely works for Appurushîdo

Code: Select all

{net.sourceforge.filebot.WebServices.IMDb.scrape(imdbid, '''//SPAN[@class='title-extra']''')}
But for Wo zhi nv ren xin it's just {n} and the page doesn't even have the SPAN[@class='title-extra'] element.
:idea: Please read the FAQ and How to Request Help.
Morgenstern72
Donor
Posts: 44
Joined: 09 May 2014, 18:57

Re: Using Original Title from IMDB in 'Foreign' Movie Names

Post by Morgenstern72 »

Thank you for this hack :)

Is there any way to detect that {n} is the same as the original title and not use it twice (and not be picky about upper/lowercase)?
I use this format
../{n}{' ("'+net.sourceforge.filebot.WebServices.IMDb.scrape(imdbid, '''//SPAN[@class='title-extra']''').match('"(.+)"')+'")'} ({y}){' ['+fn.replaceAll(/(?i)directors|theatrical/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT/).join('][').upperInitial().lowerTrail()+'] '}[{vf}] [{ac}]/{n} ({y}) {vc}{' '+lang}

Example:
the_color_of_magic -> The Colour of Magic ("The Colour of Magic")....
http://www.imdb.com/title/tt1079959/

Belle de Jour [1967] -> Belle de Jour ("Belle de jour")
http://www.imdb.com/title/tt0061395/?ref_=nv_sr_1
Post Reply