Access IMDB Data

Any questions? Need some help?
Post Reply
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Access IMDB Data

Post by Yannik »

I do access IMDB MovieInfo using

Code: Select all

net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(String.format("tt%07d", IMDBID), locale, true)
However, for some movies this returns an error like that:

Code: Select all

FileNotFoundException: Resource not found: http://api.themoviedb.org/3/movie/ttXXXXXXX?language=en&api_key=XXX
How can I properly get MovieInfo from a IMDB ID? (name/year would be sufficient but more info would be better of course)
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Access IMDB Data

Post by rednoah »

I guess TMDb doesn't have a mapping for this IMDb. You can add it.

But why not use {info} binding? Because u don't get localised data?
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: Access IMDB Data

Post by Yannik »

I made a getMovieInfo wrapper-method like this:

Code: Select all

def getMovieInfo(movie,locale) {
	movieInfo = null
	if (!(movie.getTmdbId() > 0)) {
		try {
			movieInfo = net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, locale)
		} catch (FileNotFoundException e) {
			movieInfo = net.sourceforge.filebot.WebServices.IMDb.getImdbApiMovieInfo(movie)
		}
	} else {
		movieInfo = net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, locale)
	}
	return movieInfo
}
Do you think this is good?
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Access IMDB Data

Post by rednoah »

Yeah, in MediaBindingBean I do something similar. Movie objects may have imdb or tmdb depending on how it was retrieved. I'm also just checking for what info i have and how to get the rest if possible.
:idea: Please read the FAQ and How to Request Help.
Post Reply