trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong TMDB/TVDB ids for some shows

brandonguigo opened this issue · comments

Hello guys,

I've developed a quick python script that uses the Trakt API with Tautulli to scrobble my watched content on my plex.

I've tried in postman with Good Doctor S01E01, it worked perfectly.
When I wanted to try it live with my current show Suits (2011), Tautulli sent the right TMDB/TVDB id to the script that have pushed it to the Trakt API (tried boths). I've tried to reproduce the issue in postman with the tmdb id : 37680 and it returned me a completely other episode name and the wrong show.

Here's the request and it's result with headers :

POST https://api.trakt.tv/scrobble/start
headers:
trakt-api-key: my_key
trakt-api-version: 2
Content-type: application/json

BODY: {"episode": {"season": 5, "number": 12, "ids": {"tmdb": 37680}}, "progress": 75, "app_version": "1.0", "app_date": "2022-10-13"}

RESPONSE:
{
    "id": 0,
    "action": "start",
    "progress": 75,
    "sharing": {
        "facebook": false,
        "twitter": false,
        "tumblr": false
    },
    "episode": {
        "season": 1,
        "number": 32,
        "title": "Spin the Batfink",
        "ids": {
            "trakt": 41466,
            "tvdb": 835361,
            "imdb": null,
            "tmdb": 37680,
            "tvrage": null
        }
    },
    "show": {
        "title": "Batfink",
        "year": 1966,
        "ids": {
            "trakt": 663,
            "slug": "batfink",
            "tvdb": 82703,
            "imdb": "tt11425960",
            "tmdb": 665,
            "tvrage": null
        }
    }
}

I think for some show, the ids section is completly wrong which causes the wrong episode in the wrong show to be scrobbled.

Can you look into that ?

Thanks :)

You are sending TMDB ID 37680 to find the episode, which the API is doing correctly. It's finding https://trakt.tv/shows/batfink/seasons/1/episodes/32.

What you actually want to do is send the show TMDB ID for Suits, so the JSON structure needs to reflect that.

{
  "show": {
    "title": "Suits",
    "ids": {
      "tmdb": 37680
    }
  },
  "episode": {
    "season": 5,
    "number": 12
  }
}

Oh okay, i've just tried and of course it fixes my script !

After checking with the doc, it's mentionned inside it but it's not very clear, can you maybe describe more in the JSON POST Data description instead of redirecting to the whole lot of examples to make it clearer ? :)

thanks for the help !