cinemagoer icon indicating copy to clipboard operation
cinemagoer copied to clipboard

Getting episodes of a series for a particular actor

Open cody-stclair opened this issue 5 years ago • 2 comments

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 person should 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"

cody-stclair avatar Jan 27 '21 19:01 cody-stclair

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.

alberanid avatar Mar 21 '21 16:03 alberanid

That's the fallback I've been using. Slow (especially for long-running series), but it works. Thank you!

cody-stclair avatar Mar 21 '21 16:03 cody-stclair

@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 avatar May 09 '23 06:05 markusait

@markusait please refer to the documentation: https://cinemagoer.readthedocs.io/en/latest/

The "actor" object contains various keys and properties that you can access.

alberanid avatar May 13 '23 11:05 alberanid