Re: [imdbpy-help] Getting writers attributes

4 views
Skip to first unread message

Davide Alberani

unread,
Sep 12, 2022, 4:16:45 PM9/12/22
to imdbpy...@googlegroups.com, Hedias Idis
Hi Hedias,
some of the information you are looking for are included in the
"notes" attributes of a Person instance.

In the case of cast members, more information about the role can be
found in the "currentRole" attribute.

As an example, using the same data as in your code:

#!/usr/bin/env python

import imdb

ia = imdb.Cinemagoer()
m_id = "0109830"
movie = ia.get_movie(m_id)

for writer in movie.get('writers', []):
if not writer:
continue
print('name: %s, notes: %s' % (writer['name'], writer.notes))


Will output:
name: Winston Groom, notes: (novel)
name: Eric Roth, notes: (screenplay)

(apparently there are some bugs and the list may contain empty Person
instances... we really need more developers :-))

If some data is different from the one you find on the main page of
IMDb for a title, keep in
mind that we parse the "reference" page, for movies. E.g.:
https://www.imdb.com/title/tt0109830/reference


Hope this helps,

On Tue, Jun 7, 2022 at 10:09 AM Hedias Idis <saideh...@gmail.com> wrote:
>
> Hi, on the IMDB Website the item writers has also attributes such as 'story' or 'writers'.
>
> The output of the code below is a list of names and ids, but don't contain the attributes.
>
> import imdb
> ia = imdb.IMDb()
> m_id = "0109830"
> movie = ia.get_movie(m_id)
> print(movie.get('writers'))
>
> Is there a way to get the attributes?
>
> --
> You received this message because you are subscribed to the Google Groups "imdbpy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to imdbpy-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/imdbpy-users/6d27ae68-9ea2-4ab2-a9d0-9ff98a18ce45n%40googlegroups.com.



--
Davide Alberani <davide....@gmail.com> [PGP KeyID: 0x3845A3D4AC9B61AD]
http://www.mimante.net/
Reply all
Reply to author
Forward
0 new messages