Skip to content

get_by_id doesn't work in all cases. #7

Answered by fcakyon
wf5w asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @wf5w,

IDs starting with tt are for movies/series/episodes, and IDs starting with nm are for persons.

get_by_id is for movies/series/espisodes. You should use person_by_id for IDs starting with nm:

>>> from imdbmovies import IMDB
>>> imdb = IMDB()
>>> res = imdb.person_by_name('Rajkummar Rao') #OR imdb.person_by_id("nm3822770")
>>> print(res)
>>> {
    "url": "/name/nm3822770/",
    "name": "Rajkummar Rao",
    "image": "https://m.media-amazon.com/images/M/MV5BMzAxNWIzOWItMDM1NC00NGMyLWIwMDEtNWZjODEyOTFiZjQ4XkEyXkFqcGdeQXVyNjY1MTg4Mzc@._V1_.jpg",
    "jobTitle": "Actor",
    "description": "Raj Kumar is also known as Rajkummar Rao. He was born in Gurgaon. He finished his schooling i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fcakyon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants