The Movie Database 支持

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 回复(第 1 页,共 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 .

找不到电影或剧集?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)前一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区