Assistance de TMDB

Hello, Unfortunately I'm unable to get any results when using the credits() method. When the method is called, it runs, but all it displays is "TMDb Obj" , nothing related to the cast or the crew. How can I solve this? , What's the problem here? Thanks in advance. a picture of the code, If it's doesn't display, just ignore it.

2 réponses (sur la page 1 sur 1)

Jump to last post

We can only help you to specify correct API query, if you are using some wrapper library, you must contact its author. As for the credits method, you must specify correct credit_id, which you will find in TV or movie credits. E.g.:

You can call movie credits API method to get a list of actors for movie Hanabi:

https://api.themoviedb.org/3/movie/5910/credits?api_key=###

Which will return json object:

{
  "id": 5910,
  "cast": [
    {
      "cast_id": 10,
      "character": "Nishi Yoshitaka",
      "credit_id": "52fe442cc3a36847f8086943",
      "gender": 2,
      "id": 3317,
      "name": "Takeshi Kitano",
      "order": 0,
      "profile_path": "/xkXZ7HC8uyhu5MtNnbdP8mhdiFN.jpg"
    },
...
}

And then you can call credits method for Takeshi Kitano character:

https://api.themoviedb.org/3/credit/52fe442cc3a36847f8086943?api_key=###

Which will return json with detailed information:

{
  "credit_type": "cast",
  "department": "Acting",
  "job": "Actor",
  "media": {
    "adult": false,
    "backdrop_path": "/zla8dwuIom4ZabzZzqlR8RqGUAx.jpg",
    "genre_ids": [
      80,
      18
    ],
    "id": 5910,
    "original_language": "ja",
    "original_title": "はなび",
    "overview": "A police officer leaves the force in the face of harrowing personal and professional difficulties. Spiraling into a depression, he makes questionable decisions.",
    "poster_path": "/55EBBrHskI3WzmAwGJwGXiSoHBH.jpg",
    "release_date": "1997-09-03",
    "title": "Fireworks",
    "video": false,
    "vote_average": 7.6,
    "vote_count": 227,
    "popularity": 5.895,
    "character": "Nishi Yoshitaka"
  },
  "media_type": "movie",
  "id": "52fe442cc3a36847f8086943",
  "person": {
    "adult": false,
    "gender": 2,
    "name": "Takeshi Kitano",
    "id": 3317,
    "known_for": [
      {
        "adult": false,
        "backdrop_path": "/jGPSVArC0GS2VVc0aGAqGTjfFOG.jpg",
        "genre_ids": [
          28,
          878,
          53,
          18
        ],
        "id": 315837,
        "original_language": "en",
        "original_title": "Ghost in the Shell",
        "overview": "In the near future, Major is the first of her kind: a human saved from a terrible crash, then cyber-enhanced to be a perfect soldier devoted to stopping the world's most dangerous criminals.",
        "poster_path": "/si1ZyELNHdPUZw4pXR5KjMIIsBF.jpg",
        "release_date": "2017-03-29",
        "title": "Ghost in the Shell",
        "video": false,
        "vote_average": 6,
        "vote_count": 5263,
        "popularity": 17.289,
        "media_type": "movie"
      },
...      
}

I think in python it's a bit different, in python it says you need to call credits method and add the movie id as a parameter, so basically I was calling it like this, movie.credits(movie id here) . What is written in the documentary probably isn't usable for python, the credits method should give you information about actors/actresses involved in the movie(their names), not personal information about a single character like it's ID. Regarding the library I'm using, it's called tmdbv3api . Thanks very much .

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion