Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot retrieve keywords #485

Open
Dougis1 opened this issue Oct 19, 2023 · 1 comment
Open

Cannot retrieve keywords #485

Dougis1 opened this issue Oct 19, 2023 · 1 comment

Comments

@Dougis1
Copy link

Dougis1 commented Oct 19, 2023

I tried getting the keywords for a movie and it returned nothing. However I can find the keywords listed on the imdb website.

Python 3.11
cinemagoer 2022.12.4
movie id 0492967

I updated all the python packages.

#!/usr/bin/env python

# your code here
from imdb import Cinemagoer

ia = Cinemagoer()
mvie = ia.get_movie('0492967')
ia.get_movie_infoset()
['airing', 'akas', 'alternate versions', 'awards', 'connections', 'crazy credits', 'critic reviews', 'episodes', 'external reviews', 'external sites', 'faqs', 'full credits', 'goofs', 'keywords', 'list', 'locations', 'main', 'misc sites', 'news', 'official sites', 'parents guide', 'photo sites', 'plot', 'quotes', 'recommendations', 'release dates', 'release info', 'reviews', 'sound clips', 'soundtrack', 'synopsis', 'taglines', 'technical', 'trivia', 'tv schedule', 'video clips', 'vote details']

ia.update(mvie, ['plot', 'keywords', 'awards', 'reviews', 'taglines', 'synopsis'])
print(mvie['keywords'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/doug/.local/lib/python3.11/site-packages/imdb/utils.py", line 1503, in __getitem__
    rawData = self.data[key]
              ~~~~~~~~~^^^^^
KeyError: 'keywords'

print(mvie['awards'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/doug/.local/lib/python3.11/site-packages/imdb/utils.py", line 1503, in __getitem__
    rawData = self.data[key]
              ~~~~~~~~~^^^^^
KeyError: 'awards'

sorted(mvie.keys())
['akas', 'art department', 'art direction', 'canonical title', 'cast', 'certificates', 'cinematographer', 'color info', 'composer', 'costume designer', 'countries', 'country codes', 'cover url', 'director', 'editor', 'full-size cover url', 'genres', 'imdbID', 'kind', 'language codes', 'languages', 'localized title', 'long imdb canonical title', 'long imdb title', 'original air date', 'original title', 'plot', 'plot outline', 'producer', 'production companies', 'production design', 'production manager', 'rating', 'reviews', 'runtimes', 'smart canonical title', 'smart long imdb canonical title', 'sound crew', 'sound mix', 'title', 'visual effects', 'votes', 'writer', 'year']

I can not retrieve the data I need.  The movie infoset lists the keys, but after I do the update only some of the new keys were added.  All I get back is that the keys are invalid.
@MikeX777
Copy link

MikeX777 commented Nov 6, 2023

I ran into this issue as well. I created a PR to partially fix this. Unsure how it was when it was initially designed, but currently keywords seem to be lazy loaded based on clicking to load more. This fix only returns the top 50 because of that. However I was able to use it locally in your use case and retrieve keywords. Hopefully this unblocks you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants