Getting episodes of a series for a particular actor
Issue description
It doesn't seem to be possible to get a list of episodes of a TV series that an actor appeared in. The documentation provides this code to demonstrate how to do this, but the code rasies an error.
Version of IMDbPY, Python and OS
NOTICE: please always try the latest version from the repository before submitting a bug.
- Python: Python 3.8.5
- IMDbPY: 2021.01.24
- OS: Ubuntu 20.04.1
Steps to reproduce the issue
#!python3
from imdb import IMDb
ia = IMDb()
person = ia.get_person('0005041')
ia.update(person, 'episodes')
# Alternatively, person = ia.get_person('0005041', info=['episodes'])
What's the expected result?
- The object
personshould get an additional key'episodes'whose value is a dictionary mapping TV series to episodes which the actor/actress was involved with.
What's the actual result?
- The following error is raised:
unknown information set "episodes"
The /episodes page for persons is no longer available; we need to update the documentation to reflect this.
I fear that there is no easy way to get all the episodes for a specific person: you have to parse their filmography, download the data for the TV series (specifically the list of episodes), and for each one get the cast and see if the person is in it. Not so simple, and very slow.
That's the fallback I've been using. Slow (especially for long-running series), but it works. Thank you!
@alberanid when printing the filmography like this
actor = ia.get_person(actor_id)
print(actor['filmography']['actor'])
the output shows the first appearance and the latest appearance of the actor in the show:
[ <Movie id:2505072[http] title:_The Red Road (2015) (2014)_>, <Movie id:3566834[http] title:_Minecraft (2024)_>]
How can I get these values (without doing string parsing) ? What is the key name?
@markusait please refer to the documentation: https://cinemagoer.readthedocs.io/en/latest/
The "actor" object contains various keys and properties that you can access.