IMDBPY - how to get the series from an episode?

176 Views Asked by At

I have an episode-id and from this I want to derive the series. How can I do that?

This is what I tried:

ia = IMDb()
movie = ia.get_movie(id)
if movie['kind'] == "episode":
    series = movie['episode of']
    print(series)

This gives me only the series title, allthough the documentation says, 'episode of' gives in addition the id of the series.

1

There are 1 best solutions below

0
Davide Alberani On

The series object stored in the 'episode of' key is an instance of the Movie class, so you can access the series ID using:

imdbID = series.movieID

You can also update the information of the Movie instance so that more information (besides title and ID) are collected, with something like:

ia.update(series)