[Python] Python IMDB / Cinemagoer library doesn't really work

Discussão em 'Python' iniciado por Stack, Agosto 29, 2025.

  1. Stack

    Stack Membro Participativo

    I've long relied on an old IMDB python script to sort out my movie collection, but that stopped working recently. I don't know python but I'm trying to write a simple script to obtain basic info from imdb, using the updated successor to ImdbPy: Cinemagoer or CinemagoerNG but none of the examples really work and I'm nonplussed as to why.

    For instance the example on page 7 here, slightly simplified below:

    >>> from imdb import Cinemagoer
    >>> ia = Cinemagoer()
    >>> movie = ia.get_movie('0133093')
    >>> movie
    <Movie id:0133093[http] title:_The Matrix (1999)_>
    >>> movie['directors']
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/dargaud/.venvs/MyEnv/lib/python3.12/site-packages/imdb/utils.py", line 1503, in __getitem__
    rawData = self.data[key]
    ~~~~~~~~~^^^^^
    KeyError: 'directors'


    Obviously the key here doesn't exist, and yet in their example it does. So what is going on ? Version difference ? I'm using it badly ? How do I get the list of directors of a movie in either Cinemagoer or CinemagoerNG ?

    Continue reading...

Compartilhe esta Página