The Movie Database qoldaýy

Hi, I'm beginner with the concept of api. I'd like to take the name of the director, actor, and the time of the movie by tmdb. I seen many post about found director but not in python... Could you help me ?

11 jaýap (1 ishinen 1 betinde)

Jump to last post

You need to request your own developer API key in your TMDB API settings. Then if you are looking for an easy and quick way to use our API, you can use some python wrapper library. You can find examples of python code on their github pages.

tmdb.API_KEY = key
movie = tmdb.Movies(603) #matrix
response = movie.credits()

I can have the credit but i don't found the command for take the inforamtion only for director and actor

You have to search for directors in movie.crew manually:

response = movie.credits()  
directors = [credit for credit in movie.crew if credit["job"] == "Director"]  

or in less fancy but more readable way:

directors = []  
for credit in movie.crew:  
    if credit["job"] == "Director":  
        directors.append(credit)  

As for actors, they are stored in movie.cast:

actors = movie.cast

Thank you very much ! Two question: and for the film's duration ? What's meaning .crew ?

Using tmdbsimple you can get movie runtime this way:

response = movie.info()  
runtime = movie.runtime  

In tmdbsimple movie.crew and movie.cast are variables of object movie created after successful calling of function movie.credits(). Similarly, the variable movie.runtime is created after successful calling of function movie.info() (along with other variables like movie.title, movie.release_date and so on). Btw. you can get the same results from dict object returned by functions movie.credits() and movie.info():

response = movie.credits()
crew = movie.crew
actors = movie.cast

response2 = movie.info()
runtime = movie.runtime

is the same as

response = movie.credits()
crew = response["crew"]
actors = response["cast"]

response2 = movie.info()
runtime = response2["runtime"]

Okay, thank you for your support grinning

np grinning

Could you please help me in getting this using JavaScript? Issue is some movie have director in credits and some do not. Help !!

Sorry, I can help you with a python only. Try to look for some general advice on https://stackoverflow.com/

@talestalker said:

Using tmdbsimple you can get movie runtime this way:

response = movie.info()  
runtime = movie.runtime  

In tmdbsimple movie.crew and movie.cast are variables of object movie created after successful calling of function movie.credits(). Similarly, the variable movie.runtime is created after successful calling of function movie.info() (along with other variables like movie.title, movie.release_date and so on). Btw. you can get the same results from dict object returned by functions movie.credits() and movie.info():

response = movie.credits()
crew = movie.crew
actors = movie.cast

response2 = movie.info()
runtime = movie.runtime

is the same as

response = movie.credits()
crew = response["crew"]
actors = response["cast"]

response2 = movie.info()
runtime = response2["runtime"]

java????

@talestalker said:

Using tmdbsimple you can get movie runtime this way:

response = movie.info()  
runtime = movie.runtime  

In tmdbsimple movie.crew and movie.cast are variables of object movie created after successful calling of function movie.credits(). Similarly, the variable movie.runtime is created after successful calling of function movie.info() (along with other variables like movie.title, movie.release_date and so on). Btw. you can get the same results from dict object returned by functions movie.credits() and movie.info():

response = movie.credits()
crew = movie.crew
actors = movie.cast

response2 = movie.info()
runtime = movie.runtime

is the same as

response = movie.credits()
crew = response["crew"]
actors = response["cast"]

response2 = movie.info()
runtime = response2["runtime"]

java??

Fılmdi nemese kórsetimdi taba almadyńyz ba? Ony jasaý úshin kirińiz.

Ǵalamdyq

s kezelimdi izdeý jolaǵyna aýystyrý
p profaıl mázirin ashý
esc ashyq terezeni jabý
? perneler tirkesimi terezesin ashý

Tasyǵyshtar betterinde

b artqa oralý (nemese qoldanylatyn bolsa, tektikke)
e óńdeý betine ótý

Telemaýsym betterinde

(oń jaq kórsetki) kelesi telemaýsymǵa ótý
(sol jaq kórsetki) aldyńǵy telemaýsymǵa ótý

Epizod betterinde

(oń jaq kórsetki) kelesi epızodqa ótý
(sol jaq kórsetki) aldyńǵy epızodqa ótý

Barlyq keskin betterinde

a keskin ústeý terezesin ashý

Barlyq óńdeý betterinde

t tárjime tańdaǵyshyn ashý
ctrl+ s pishindi jiberý

Talqylaý betterinde

n jańa talqylaýdy jasaý
w qaralǵan kúıin aýystyrý
p jalpy/jekeni aýystyrý
c jabý/ashýdy aýystyrý
a áreketterdi ashý
r talqylaýǵa jaýap berý
l sońǵy jaýapqa ótý
ctrl+ enter habaryńyzdy jiberý
(oń jaq kórsetki) kelesi betke
(sol jaq kórsetki) aldyńǵy betke

Parametrler

Want to rate or add this item to a list?

Kirý