Can I retrieve IMDb's movie recommendations for a given movie using IMDbPY?
Asked Answered
O

1

13

I'm using IMDbPY to retrieve all kinds of data about movies. For example, if I have a movie object of "Pulp Fiction (1994)" then I can get the name of its (first) director like this:

>>> pulp_fiction['director'][0]['name']
    u'Quentin Tarantino'

Or the name of the third actor:

>>> pulp_fiction['cast'][2]['name']
    u'Samuel L. Jackson'

In ways similar to this I can retrieve all kinds of information for a given movie (budget, length, storyline, list of goofs, trivia, etc).

The piece of information I'm looking for is recommendations (other movies similar to the current movie). IMDb provides such a thing for each movie:

pulp fiction recommendations

Is it possible to access the recommendations using IMDbPY? If not, is there another way to access the recommendations which doesn't require me to parse webpages?

Olsen answered 17/3, 2011 at 16:45 Comment(2)
Pineapple Express is a terrible recommendation for someone who liked Pulp Fiction.Quinquepartite
Nothing documented I'm afraid. You could try to reverse engineer how they do it on the website and implement that yourself?Titanite
B
9

Looking in the source, I found something:

http://bitbucket.org/alberanid/imdbpy/src/579c50b280f9/imdb/parser/http/init.py

check def get_movie_recommendations(self, movieID)

I haven't tried it, but it looks like it might be doing what you are looking for.

Brandeebranden answered 17/3, 2011 at 17:33 Comment(2)
Thanks. Don't they have any documentation? Is the only way to see IMDbPY's features looking at the source code?Olsen
It appears that there is just a bunch of README files but no official documentation. Not ideal to say the least.Brandeebranden

© 2022 - 2024 — McMap. All rights reserved.