trakt/Plex-Trakt-Scrobbler

tv shows not scrobbling with new scanner/agent

Opened this issue ยท 71 comments

i have recently created a new movies and tv shows library using the new scanner and agent.

the new movies library, using the PLEX MOVIE scanner and agent are scrobbling properly. i am able to verify that it's able to push and pull watched items and i am able to see the progress of the movie i am watching on trakt.

however, it's not the case for the new tv shows library, using the PLEX TV SERIES scanner and agent. i can confirm that scrobbling on my old library works, using the PLEX SERIES SCANNER.

for now, i'm keeping my old library and continue to watch tv shows from there. hopefully the devs can update the plug-in to support the new scanner/agent.

I'm seeing the same issue. Looking at the webhook payload that is sent when playback starts, the formatting of the IDs is a bit different when using the new Plex TV agent.

This the metadata when using old scanner:

Metadata":{
"librarySectionType":"show",
"ratingKey":"104560",
"key":"/library/metadata/104560",
"parentRatingKey":"104558",
"grandparentRatingKey":"104557",
"guid":"com.plexapp.agents.thetvdb://362829/1/1?lang=en",
"parentGuid":"com.plexapp.agents.thetvdb://362829/1?lang=en",
"grandparentGuid":"com.plexapp.agents.thetvdb://362829?lang=en",
"type":"episode",
"title":"Pilot",
"grandparentKey":"/library/metadata/104557",
"parentKey":"/library/metadata/104558",
"librarySectionTitle":"TV Shows",
"librarySectionID":2,
"librarySectionKey":"/library/sections/2",
"grandparentTitle":"Mythic Quest",
"parentTitle":"Season 1",
"contentRating":"TV-MA",
"summary":"As the hit video game Mythic Quest prepares to launch its newest update, creator Ian Grimm obsesses over a seemingly minor detail.",
"index":1,
"parentIndex":1,
"viewCount":1,
"lastViewedAt":1605071175,
"year":2020,
"thumb":"/library/metadata/104560/thumb/1620465313",
"art":"/library/metadata/104557/art/1620465313",
"parentThumb":"/library/metadata/104558/thumb/1590256581",
"grandparentThumb":"/library/metadata/104557/thumb/1620465313",
"grandparentArt":"/library/metadata/104557/art/1620465313",
"grandparentTheme":"/library/metadata/104557/theme/1620465313",
"originallyAvailableAt":"2020-02-07",
"addedAt":1581053423,
"updatedAt":1620465313,
"Writer":[
{
"id":11342,
"filter":"writer=11342",
"tag":"Charlie Day"
},
{
"id":11378,
"filter":"writer=11378",
"tag":"Megan Ganz"
},
{
"id":11343,
"filter":"writer=11343",
"tag":"Rob McElhenney"
}
]

and this is the metadata when using the new Plex TV Scanner

"Metadata":{
"librarySectionType":"show",
"ratingKey":"104560",
"key":"/library/metadata/104560",
"parentRatingKey":"104558",
"grandparentRatingKey":"104557",
"guid":"plex://episode/5e16137d4e7a9b001ec08b37",
"parentGuid":"plex://season/602e76a4de471d002d080f62",
"grandparentGuid":"plex://show/5d9c0922170e24001f2af500",
"type":"episode",
"title":"Pilot",
"grandparentKey":"/library/metadata/104557",
"parentKey":"/library/metadata/104558",
"librarySectionTitle":"TV Shows",
"librarySectionID":2,
"librarySectionKey":"/library/sections/2",
"grandparentTitle":"Mythic Quest",
"parentTitle":"Season 1",
"contentRating":"TV-MA",
"summary":"As the hit video game Mythic Quest prepares to launch its newest update, creator Ian Grimm obsesses over a seemingly minor detail.",
"index":1,
"parentIndex":1,
"audienceRating":8.2,
"viewCount":1,
"lastViewedAt":1605071175,
"parentYear":2020,
"thumb":"/library/metadata/104560/thumb/1620367553",
"art":"/library/metadata/104558/art/1620367553",
"parentThumb":"/library/metadata/104558/thumb/1620367553",
"grandparentThumb":"/library/metadata/104557/thumb/1620367553",
"grandparentArt":"/library/metadata/104557/art/1620367553",
"grandparentTheme":"/library/metadata/104557/theme/1620367553",
"originallyAvailableAt":"2020-02-07",
"addedAt":1581053423,
"updatedAt":1620367553,
"audienceRatingImage":"themoviedb://image.rating",
"Director":[
{
"id":10293,
"filter":"director=10293",
"tag":"David Gordon Green"
}
],
"Writer":[
{
"id":11343,
"filter":"writer=11343",
"tag":"Rob McElhenney"
},
{
"id":11378,
"filter":"writer=11378",
"tag":"Megan Ganz"
},
{
"id":11342,
"filter":"writer=11342",
"tag":"Charlie Day"
}
],
"Guid":[
{
"id":"imdb://tt9719170"
},
{
"id":"tmdb://1969147"
},
{
"id":"tvdb://7501639"
}
],
"Role":[
{
"id":45959,
"filter":"actor=45959",
"tag":"Elisha Henig",
"role":"Pootie Shoe",
"thumb":"https://metadata-static.plex.tv/people/5d776c657a53e9001e741fe7.jpg"
},
{
"id":95715,
"filter":"actor=95715",
"tag":"Naomi Ekperigin",
"role":"Carol",
"thumb":"https://metadata-static.plex.tv/people/5e164adf61c6140040d80b49.jpg"
}
]
}

Both are for the same episode file from 2 different servers, one with old scanner and one with the new. I think the plugin needs to be updated to look for the new Guid fields

There is a commit in the main code if you just download the source the issue is fixed. Has been fixed since august 31, 2020. It is not released it is open source so just download the working code man.

you mean download this directly and replace the existing files and folders? https://github.com/trakt/Plex-Trakt-Scrobbler/tree/master/Trakttv.bundle

i already tried that. i also tried using the following forks which has the above-mentioned commit already included in the release.

scrobbling for tv shows only works if you've never watched the show.

if you marked the first few episodes or seasons as watched, any episode you watch after that will be a hit or miss. sometimes, it'll scrobble but most of the time it won't.

if you mark any show, season, or episode as watch on plex, it doesn't sync it to trakt. and any shows, seasons, or episodes already marked as watch on trakt doesn't sync to plex either. the sync function for tv shows doesn't work at all.

i had no issues with movies, as previously mentioned. this one works smoothly.

I would delete the existing package you have installed. The entire folder. And copy the new folder into your plugin folder

The plugin is already patched to work with the new TV agent. There are a few important aspects to highlight though

  1. Syncs using this plugin are not properly defined. By default, sync only pushes all the data in Plex, but pulls changes from Trakt into Plex since the last authentication. This means that anything already marked as watched on Trakt will not be synced into Plex with the scheduled sync. To fix this, you need to use a tool like Kitana to access the plugin menu, and from the plugin menu, run the Full Pull task. This will pull the entirety of your Trakt watched status into Plex, even historical data. This is the only way to do this.

  2. Scrobbling does not care about whether you have seen the show or not. Scrobbles and playback progress use the episode GUID of the show. This is not always available, though it should be fairly common for stuff that was not recently aired and not super obscure. For stuff that just aired, these guids are not always populated right away. They get populated during periodic metadata refreshes, but if you watch as soon as you add it, then the scrobble/playback progress will not work.

  3. While the above sounds bad, the scheduled sync task actually uses a different method to push data to Trakt. It uses Season + Episode numbers and the show's GUID. If you run this at regular intervals, it should catch stuff that was missed from above and sync it to Trakt. It is also the only way to sync stuff you manually marked watched.

It is important to use the webpage and Kitana to verify that your settings are correct for this to function properly. But it should have no issues with the new agent. I've been using it since the agent was in beta, and it's been completely accurate (as far as I can tell) with syncing to Trakt...and I watched a ton of TV in that time.

Modifying the behavior for the agent is complicated as it is built like a house of cards. The changes I made to the plugin to get it to work with the new native movie and TV agents were lucky because I was able to make a small change in a precise location that had the desired effect without disturbing anything else. While it can be improved further, those changes are maybe too much for me considering the potential for breaking it as well as the fact that it works perfectly as is for me already.

Thanks for the detailed explanation. I've uploaded the xml files of the episodes that cannot be scrobbled as well as my settings of the TV show library. Two of the episode are the latest that just come out yesterday while the other one has been out for a week.

To test if it's because the show is too new to be available for TrakT or Plex, I purchased the TrakT VIP and tested scrobbling with the Webhook solution. I also tested Infuse with plex media (which has TrakT integrated). All episodes from the xmls.zip can be scrobbled properly (including the playback progress, the time finished watching, etc.) with these solutions.

In that case, I suspect, maybe it's related to how I manage my TV library settings such as the tv agent used or whether include adult content is enabled. Since I'm not familiar with the code of the scrobbler, I was thinking to use a network traffic capture tool to capture the network traffic that of the API request. Since the "404 not found" are returned from the following APIs: https://api.trakt.tv/scrobble/start (pause/stop). I was wondering if there can be something wrong with the request. Maybe the Guid is missing or incorrect? I'm not sure if the TrakT API takes the IMDB schema from the first id of the Guid field as a valid id. The TratT documentation takes the TVDB id as an example for the episode. However, I haven't tried capturing these requests yet.

On the other hand, is it possible to find detailed information of the URL, request body, and response from the log files directly? If that's possible, it would be much easier to locate and fix the issue I'm encountering.

Thanks again!

xmls.zip
image
image
image
image
image

I would delete the existing package you have installed. The entire folder. And copy the new folder into your plugin folder

Thanks, this worked for me!

  1. Syncs using this plugin are not properly defined. By default, sync only pushes all the data in Plex, but pulls changes from Trakt into Plex since the last authentication. This means that anything already marked as watched on Trakt will not be synced into Plex with the scheduled sync. To fix this, you need to use a tool like Kitana to access the plugin menu, and from the plugin menu, run the Full Pull task. This will pull the entirety of your Trakt watched status into Plex, even historical data. This is the only way to do this.

Running Pull from Trakt.tv worked. Apparently, it seems like Full doesn't perform a 2-way sync.

  1. Scrobbling does not care about whether you have seen the show or not. Scrobbles and playback progress use the episode GUID of the show. This is not always available, though it should be fairly common for stuff that was not recently aired and not super obscure. For stuff that just aired, these guids are not always populated right away. They get populated during periodic metadata refreshes, but if you watch as soon as you add it, then the scrobble/playback progress will not work.

I have since purchased Plex Pass and Trakt VIP and enabled scrobbling using webhooks.

Thank you everyone for your help!

Thanks for the detailed explanation. I've uploaded the xml files of the episodes that cannot be scrobbled as well as my settings of the TV show library. Two of the episode are the latest that just come out yesterday while the other one has been out for a week.

Yes, all three XMLs have the proper GUIDs for the episodes. I also tested one of these exact same episodes on my own server, and playback progress worked, as well as scrobble, as well as syncing watched status. To confirm, neither are working for you? Sync nor scrobble? And that it is not working at all, or just for specific episodes?

To test if it's because the show is too new to be available for TrakT or Plex, I purchased the TrakT VIP and tested scrobbling with the Webhook solution. I also tested Infuse with plex media (which has TrakT integrated). All episodes from the xmls.zip can be scrobbled properly (including the playback progress, the time finished watching, etc.) with these solutions.

Yes, these solutions use a different method compared to the plugin. The plugin method is more dated. That said, as I mentioned above, the plugin should work fine for these episodes as well. It is worth trying to pull and replace the very latest version of the plugin to make sure there isn't some local changes or an older version causing issues.

In that case, I suspect, maybe it's related to how I manage my TV library settings such as the tv agent used or whether include adult content is enabled. Since I'm not familiar with the code of the scrobbler, I was thinking to use a network traffic capture tool to capture the network traffic that of the API request. Since the "404 not found" are returned from the following APIs: https://api.trakt.tv/scrobble/start (pause/stop). I was wondering if there can be something wrong with the request. Maybe the Guid is missing or incorrect? I'm not sure if the TrakT API takes the IMDB schema from the first id of the Guid field as a valid id. The TratT documentation takes the TVDB id as an example for the episode. However, I haven't tried capturing these requests yet.

The IMDb ID format is perfectly fine. I'm not sure if you can turn on the debug settings for the plugin to pull this info, but the request itself should be okay as it works for me and others. Your TV settings should bear no connection to the plugin as the episodes already have the relevant guids. I am using TVDB ordering instead of TMDB, but everything else seems the same between our settings anyways. The plugin settings are probably far more relevant. Mine are given below

image
image

Yes, all three XMLs have the proper GUIDs for the episodes. I also tested one of these exact same episodes on my own server, and playback progress worked, as well as scrobble, as well as syncing watched status. To confirm, neither are working for you? Sync nor scrobble? And that it is not working at all, or just for specific episodes?

I'm only using the scrobble function so I haven't tested syncing.

Yes, these solutions use a different method compared to the plugin. The plugin method is more dated. That said, as I mentioned above, the plugin should work fine for these episodes as well. It is worth trying to pull and replace the very latest version of the plugin to make sure there isn't some local changes or an older version causing issues.

Yeah. But I'm using this plugin for the first time so I guess there's nothing to replace. By the way I'm using the code from your fork instead of the code from this repo.

The IMDb ID format is perfectly fine. I'm not sure if you can turn on the debug settings for the plugin to pull this info, but the request itself should be okay as it works for me and others. Your TV settings should bear no connection to the plugin as the episodes already have the relevant guids. I am using TVDB ordering instead of TMDB, but everything else seems the same between our settings anyways. The plugin settings are probably far more relevant. Mine are given below

I'll further look into it, thanks!

I deleted all trakt related folders and copied the latest Trakttv.bundle to my synology but i am getting the following error. Any ideas?

2021-06-30 10:24:10,037 - com.plexapp.plugins.trakttv      (7f7a8b1d2808) :  CRITICAL (com.plexapp.plugins.trakttv:615) - Exception starting plug-in (most recent call last):
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/core.py", line 608, in start
    self.sandbox.execute(self.init_code)
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 256, in execute
    exec(code) in self.environment
  File "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Code/__init__.py", line 62, in <module>
    import interface
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 333, in __import__
    return mod.load_module(_name)
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 44, in load_module
    module = RestrictedModule(name, path, sandbox)
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 30, in __init__
    exec(code) in self.__dict__
  File "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Code/interface/__init__.py", line 4, in <module>
    import m_sync
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 333, in __import__
    return mod.load_module(_name)
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 44, in load_module
    module = RestrictedModule(name, path, sandbox)
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 30, in __init__
    exec(code) in self.__dict__
  File "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Code/interface/m_sync.py", line 8, in <module>
    from plugin.managers.account import AccountManager
  File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-ebb5fe9f3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 345, in __import__
    raise e
ImportError: No module named core

I'm having this issue as well where when I mark an episode as watched on trakt app, it doesn't sync to my Plex. Any idea what I need to do to fix this? I believe my movie 2-way sync is working perfectly, as well as when I watch TV show on Plex it gets marked as watched on trakt

@rg9400 Thank you for your work on this plugin. Unfortunately, it doesn't work for me either. I've recently updated it to the latest Plex server version on Synology and switched to the new Plex Agent (unfortunately)... since then, the original plugin has stopped working. I've tried your fork, but no luck. I've changed my plugin settings to the same as you showed above, but still no luck.

Fun fact: it works with Movies. The scrobbler is failing with TV shows only.

In the logs, I got this:

2021-09-07 20:28:19,344 - plex_activity.activity           (7efd400e8b38) :  INFO (plex_activity.activity:48) - Finished starting 1 method(s): "websocket"
2021-09-07 20:28:23,046 - com.plexapp.plugins.trakttv      (7efd4014bb38) :  INFO (com.plexapp.plugins.trakttv:131) - Saved the dictionary file
2021-09-07 20:28:42,866 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: grandparentguid
2021-09-07 20:28:42,867 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentguid
2021-09-07 20:28:42,867 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentyear
2021-09-07 20:28:42,886 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: grandparentguid
2021-09-07 20:28:42,887 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentguid
2021-09-07 20:28:42,887 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentyear
2021-09-07 20:28:42,980 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: grandparentguid
2021-09-07 20:28:42,981 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentguid
2021-09-07 20:28:42,981 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentyear
2021-09-07 20:28:44,502 - trakt.interfaces.base            (7efd3ff1ab38) :  WARNING (trakt.interfaces.base:48) - Request failed: "POST /scrobble/start" - 404: "Method exists, but no record found" (Not Found)
2021-09-07 20:29:26,927 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: grandparentguid
2021-09-07 20:29:26,927 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentguid
2021-09-07 20:29:26,928 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentyear
2021-09-07 20:29:30,143 - trakt.interfaces.base            (7efd3ff1ab38) :  WARNING (trakt.interfaces.base:48) - Request failed: "POST /scrobble/pause" - 404: "Method exists, but no record found" (Not Found)
2021-09-07 20:38:33,392 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: grandparentguid
2021-09-07 20:38:33,392 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentguid
2021-09-07 20:38:33,392 - plex.objects.core.base           (7efd3fd04b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentyear
2021-09-07 20:38:36,519 - trakt.interfaces.base            (7efd3ff1ab38) :  WARNING (trakt.interfaces.base:48) - Request failed: "POST /scrobble/stop" - 404: "Method exists, but no record found" (Not Found)

Do you have any ideas/advice? Thanks in advance!

I'm still having issues specifically with TV Shows scribbling using rg9400's branch of the trakt plugin.

It basically is hit or miss with TV shows. I added cobra Kai S3 to my library (already had S1/S2 in Plex and both marked as played), which I had marked S3 as fully watched on Trakt manually. S3 is showing up as unwatched in Plex. I manually marked Queen's Gambit (brand new show not in Plex) as played in Trakt web, but then when I added it to Plex it is currently marked as Unplayed.

Any idea what could be causing this?

@rg9400 just another update on the issue... I've changed the agent back on TV shows to use the legacy scanner like this:
image

But still no luck. It doesn't work. I got the same error that I mentioned above. The movies are fine.

Before the plugin update, I stopped the server and then restarted it. After I changed the agent and scanner on TV shows library, I re-ran the scanner on the whole library.

I'm using the latest master branch from this repo and my plex server version is the latest as well: 1.24.1.4931

I hope you will be able to do some magic here again... ๐Ÿ˜…

I'm still having issues specifically with TV Shows scribbling using rg9400's branch of the trakt plugin.

It basically is hit or miss with TV shows. I added cobra Kai S3 to my library (already had S1/S2 in Plex and both marked as played), which I had marked S3 as fully watched on Trakt manually. S3 is showing up as unwatched in Plex. I manually marked Queen's Gambit (brand new show not in Plex) as played in Trakt web, but then when I added it to Plex it is currently marked as Unplayed.

Any idea what could be causing this?

what is the latest branch of plex trakt plugin that works for the newest movies/tv show agent? I believe i have rg9400 and still having the issue where if i manually mark episodes/whole season as watched on trakt, it's not syncing down the the plex level. maybe i just need to refresh reinstall the plugin again but want to make sure i grab the latest / greatest.

I have to servers two server but the plug is not working in current version of the server. new version that dont work in Version 1.24.2.4973, but works on old version of the server Version 1.24.3.5033

I seem to be getting the same 404 error:
2021-09-28 16:39:45,197 - trakt.interfaces.base (7f4e4cfd6b38) : WARNING (trakt.interfaces.base:48) - Request failed: "POST /scrobble/pause" - 404: "Method exists, but no record found" (Not Found)

@krugster I was getting that, deleted and replaced the whole plugin folder again and all is working for me.

Yes, I did as well and it is working again. Thanks!

@krugster I was getting that, deleted and replaced the whole plugin folder again and all is working for me.

Which version did you reinstall? Can you link?

To be honest Iโ€™m not %100 sure. I downloaded develop, master and 1.3.3 and things didnโ€™t work right away so I swapped between a couple different ones until it did.

p3lim commented

Been annoyed by this one for a while, finally figured it out (for me): this only happens when the new Plex agent adds the year to the title of the show. If I manually remove it (e.g. "Hawkeye" instead of "Hawkeye (2021)") it works.

According to the debug logs, the imdb id for the specific episode is also used here, so the plugin should completely ignore the title of the show, and only consider the imdb id.

Before renaming the show (as in Plex used the agent and fetched the metadata for me):

plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:126) - Retrieved u'scrobble/start' action from queue
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:156) - Sending action u'scrobble/start' (account: <Account name: u'XXXXX'>, interface: u'scrobble', method: u'start')
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:212) - request: {u'progress': 0.0, u'episode': {u'season': 1, u'number': 2, u'title': u'Hide and Seek'}, u'show': {u'title': u'Hawkeye (2021)', u'ids': {u'imdb': u'tt10166576'}, u'year': None}}
plugin.models.m_trakt.account    (7f788c41eb38) :  DEBUG (plugin.models.m_trakt.account:88) - Using oauth authorization for <TraktAccount username: u'XXXXX'>
trakt.interfaces.base            (7f788c41eb38) :  WARNING (trakt.interfaces.base:48) - Request failed: "POST /scrobble/start" - 404: "Method exists, but no record found" (Not Found)
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:133) - Action u'scrobble/start' sent, moved action to history

After manually removing the year from the title of the show:

plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:126) - Retrieved u'scrobble/start' action from queue
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:156) - Sending action u'scrobble/start' (account: <Account name: u'XXXXX'>, interface: u'scrobble', method: u'start')
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:212) - request: {u'progress': 0.0, u'episode': {u'season': 1, u'number': 2, u'title': u'Hide and Seek'}, u'show': {u'title': u'Hawkeye', u'ids': {u'imdb': u'tt10166576'}, u'year': None}}
plugin.models.m_trakt.account    (7f788c41eb38) :  DEBUG (plugin.models.m_trakt.account:88) - Using oauth authorization for <TraktAccount username: u'XXXXX'>
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:133) - Action u'scrobble/start' sent, moved action to history

Issue might also be because it's not using the imdb id at all, since it's the episode id and not the show id, and it's used for the show data.
Also bothers me that the year field is None. The information this plugin gets from Plex is obviously broken.

The Trakt API can take an imdb id for both the show and the episode, I'd wager it's enough to move the imdb id supplied for the show and move it to the episode in the POST query, and that'd fix this issue, unless the scrobble API also requires the correct show imdb id.

Edit: same issue if the title contains something like "(US)" at the end.

Been annoyed by this one for a while, finally figured it out (for me): this only happens when the new Plex agent adds the year to the title of the show. If I manually remove it (e.g. "Hawkeye" instead of "Hawkeye (2021)") it works.

According to the debug logs, the imdb id for the specific episode is also used here, so the plugin should completely ignore the title of the show, and only consider the imdb id.

Before renaming the show (as in Plex used the agent and fetched the metadata for me):

plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:126) - Retrieved u'scrobble/start' action from queue
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:156) - Sending action u'scrobble/start' (account: <Account name: u'XXXXX'>, interface: u'scrobble', method: u'start')
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:212) - request: {u'progress': 0.0, u'episode': {u'season': 1, u'number': 2, u'title': u'Hide and Seek'}, u'show': {u'title': u'Hawkeye (2021)', u'ids': {u'imdb': u'tt10166576'}, u'year': None}}
plugin.models.m_trakt.account    (7f788c41eb38) :  DEBUG (plugin.models.m_trakt.account:88) - Using oauth authorization for <TraktAccount username: u'XXXXX'>
trakt.interfaces.base            (7f788c41eb38) :  WARNING (trakt.interfaces.base:48) - Request failed: "POST /scrobble/start" - 404: "Method exists, but no record found" (Not Found)
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:133) - Action u'scrobble/start' sent, moved action to history

After manually removing the year from the title of the show:

plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:126) - Retrieved u'scrobble/start' action from queue
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:156) - Sending action u'scrobble/start' (account: <Account name: u'XXXXX'>, interface: u'scrobble', method: u'start')
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:212) - request: {u'progress': 0.0, u'episode': {u'season': 1, u'number': 2, u'title': u'Hide and Seek'}, u'show': {u'title': u'Hawkeye', u'ids': {u'imdb': u'tt10166576'}, u'year': None}}
plugin.models.m_trakt.account    (7f788c41eb38) :  DEBUG (plugin.models.m_trakt.account:88) - Using oauth authorization for <TraktAccount username: u'XXXXX'>
plugin.managers.action           (7f788c41eb38) :  DEBUG (plugin.managers.action:133) - Action u'scrobble/start' sent, moved action to history

Issue might also be because it's not using the imdb id at all, since it's the episode id and not the show id, and it's used for the show data. Also bothers me that the year field is None. The information this plugin gets from Plex is obviously broken.

Edit: same issue if the title contains something like "(US)" at the end.

Do you mean changing the name of the folder that the show resides in (like the automatic folder naming sonarr adds)? Or what are you referencing that includes the year

p3lim commented

Do you mean changing the name of the folder that the show resides in (like the automatic folder naming sonarr adds)? Or what are you referencing that includes the year

In Plex, e.g:
image

Same situation here, works as soon as I remove the "(US)" from "The Office (US)" title in Plex.

Same situation here, works as soon as I remove the "(US)" from "The Office (US)" title in Plex.

are you guys both saying that if you change the name of the actual show in Plex itself to remove the suffixes (year or country), then the plugin starts working again for scrobbling?

p3lim commented

Consider the data I found from the debug logs:

{
    'progress': 0.0,
    'episode': {
        'season': 1,
        'number': 2,
        'title': 'Hide and Seek'
    },
    'show': {
        'title': 'Hawkeye (2021)',
        'ids': {
            'imdb': 'tt10166576'
        },
        'year': None
    }
}

and compare that to the Trakt scrobble API: https://trakt.docs.apiary.io/#reference/scrobble

There are a few problems with this request:

  1. .show.title contains extra information about the show that Trakt doesn't have in their own metadata (in this case it's "(2021)"), so it can't use the title to match the show
  2. .show.ids.imdb is the ID for the episode, not the show, so it's unable to match the show using that
  3. .show.year is None (null), so it's useless for matching the show

It should be clear why the plugin is failing based on that.

Now onto how to fix this:

The bare minimum the Trakt API needs to know is the following:

  • .progress to know where to start (it automatically counts how far you're into the episode)
  • .episode.ids.imdb to match the show's episode
    • could be other IDs, but we know we have the episode imdb ID already

So the fix is simply to rewrite the code in this plugin to use this format for shows:

{
    "progress": 0.0,
    "episode": {
        "ids": {
            "imdb": "tt10166576"
        }
    }
}

I tested this with manual API calls, and this is the response from Trakt API:

{
  "id": 0,
  "action": "start",
  "progress": 2,
  "sharing": {
    "facebook": false,
    "twitter": false,
    "tumblr": false
  },
  "episode": {
    "season": 1,
    "number": 2,
    "title": "Hide and Seek",
    "ids": {
      "trakt": 5612882,
      "tvdb": 8585109,
      "imdb": "tt10166576",
      "tmdb": 3273258,
      "tvrage": null
    }
  },
  "show": {
    "title": "Hawkeye",
    "year": 2021,
    "ids": {
      "trakt": 146415,
      "slug": "hawkeye-2021",
      "tvdb": 367146,
      "imdb": "tt10160804",
      "tmdb": 88329,
      "tvrage": null
    }
  }
}

So it's clear that Trakt is fully able to fill in the blanks when only given the episode imdb id.

Here's an ugly and untested patch:

diff --git a/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py b/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
index b97e9269..069ca363 100644
--- a/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
+++ b/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
@@ -114,11 +114,14 @@ class ScrobbleInterface(Interface):
             # TODO validate
             data['movie'] = movie
         elif episode:
-            if show:
-                data['show'] = show
-
-            # TODO validate
-            data['episode'] = episode
+            if show and 'ids' in show and 'imdb' in show['ids']:
+                data['episode'] = {
+                    'ids': {
+                        'imdb': show['ids']['imdb']
+                    }
+                }
+            else:
+                raise ValueError('Missing episode metadata')

         response = self.http.post(
             action,

So it's clear that Trakt is fully able to fill in the blanks when only given the episode imdb id.

Here's an ugly and untested patch:

diff --git a/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py b/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
index b97e9269..069ca363 100644
--- a/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
+++ b/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
@@ -114,11 +114,14 @@ class ScrobbleInterface(Interface):
             # TODO validate
             data['movie'] = movie
         elif episode:
-            if show:
-                data['show'] = show
-
-            # TODO validate
-            data['episode'] = episode
+            if show and 'ids' in show and 'imdb' in show['ids']:
+                data['episode'] = {
+                    'ids': {
+                        'imdb': show['ids']['imdb']
+                    }
+                }
+            else:
+                raise ValueError('Missing episode metadata')

         response = self.http.post(
             action,

Seems to work for me at least initially, thanks ๐Ÿ‘

As another person with datapoint. Iโ€™m watching the new Apple TV show โ€œFoundationโ€, and it wonโ€™t scrobble to Trakt. It also has prefix issue, named โ€œFoundation (2021)โ€ in Plex. When i change the name of the show in Plex title to just โ€œFoundationโ€, then scrobble works.

So it's clear that Trakt is fully able to fill in the blanks when only given the episode imdb id.
Here's an ugly and untested patch:

diff --git a/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py b/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
index b97e9269..069ca363 100644
--- a/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
+++ b/Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/scrobble.py
@@ -114,11 +114,14 @@ class ScrobbleInterface(Interface):
             # TODO validate
             data['movie'] = movie
         elif episode:
-            if show:
-                data['show'] = show
-
-            # TODO validate
-            data['episode'] = episode
+            if show and 'ids' in show and 'imdb' in show['ids']:
+                data['episode'] = {
+                    'ids': {
+                        'imdb': show['ids']['imdb']
+                    }
+                }
+            else:
+                raise ValueError('Missing episode metadata')

         response = self.http.post(
             action,

Seems to work for me at least initially, thanks ๐Ÿ‘

How do i go about making this change? I am using Plex on Unraid and have the add-in installed in the appdata folder (mnt/user/appdata/Plex/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle)

The file is referenced at the top of what you have quoted along with path? did you even look at it before replying? Edit scrobble.py with some text editor remove the red lines after โ€œelif episode:โ€ and replace with the green.

I have iterated on @p3lim's excellent patch. Their version will work if and only if the episode has been matched with an IMDB ID.

This version should work on episodes that have been matched with TMDB, TheTVDB, etc.

if show and 'ids' in show:
    data['episode'] = {
        'ids': show['ids']
    }
else:
    raise ValueError('Missing episode metadata')
p3lim commented

My patch was "ugly" because it's not the correct place to fix the issue, I just don't know the code well enough to fix it proper. It was just a PoC that this plugin is broken and giving a reason why.

Sorry if I gave the impression that I was dissing your patch. I'm really thankful for it! It's great that we finally have the reason behind scrobbling being flaky, and we wouldn't know the cause without your time investment.

p3lim commented

It was not the impression I got, I just don't want people to think this is the correct way to fix the issue.

Sorry if I gave the impression that I was dissing your patch. I'm really thankful for it! It's great that we finally have the reason behind scrobbling being flaky, and we wouldn't know the cause without your time investment.

Apologies for asking, but could you upload the correct scrobble.py ? I'm not very familiar with editing python files so it would be very helpful :)

p3lim commented

Apologies for asking, but could you upload the correct scrobble.py ? I'm not very familiar with editing python files so it would be very helpful :)

Copy the entire patch, save it as "scrobble.patch" in your plugins directory (e.g. next to Trakt.bundle), then run patch < scrobble.patch.

So I applied the patch suggested above and although it did resolve most of my scrobbling issues, it's not completly fool proof, I still encountered some issues with some shows where trakt wasn't acknowledging the scrobble request with just the imdb id being sent, no idea why.

After lots of trial and error I think I found the cause. This plugin currently only takes the First external identifier for an episode from the plex metadata instead of using them all. This I suspect is due to various plex changes over the years.

So the plex metadata looks something like this

<MediaContainer>
    <Video>
        <Guid id="imdb://XXXXX"/>
        <Guid id="tmdb://XXXX"/>
        <Guid id="tvdb://XXXX"/>
    </Video>
</MediaContainer>

Which this plugin only reads the first Guid (imdb) and eventually ends up as per the detailed description that @p3lim provided further up ##596 (comment)

I have very little experience in python, but I made some educated guesses and changes to try and support multiple Guid's being parsed from the plex metadata and then passing them along correctly to trakt scrobbling as episode id's and not as the show id's.
With my limited localised testing these changes now work for me, where all my shows that weren't tracking before now appear to scrobble correctly in trakt.
As an example, this is now what gets sent to trakt scrobble:

{
    "app_date": None,
    "progress": 0.21,
    "app_version": "1.3.3",
    "episode": {
        "ids": {
            "tvdb": 8287132,
            "tmdb": 2670881,
            "imdb": "tt10166574"
        }
    }
}

Please note: I have not tested these changes and there may be unforseen issues

The changes can be obtained here

The changes can be seen here:

Is that not what was done here? Or is this addressing some other issue?

I believe @Cornishman is trying to fix the underlying issue with their version.

p3lim commented

Still hacking it with the scrobble part though, the data passed to scrobble.py should be correct before it reaches that far.

The changes can be seen here:

Is that not what was done here? Or is this addressing some other issue?

I believe @Cornishman is trying to fix the underlying issue with their version.

Correct, the patch suggested further up did work for me for most of my problem shows, but some still wouldn't scrobble to trakt even with the patch, as it was only sending the imdb id, or whatever id came first, and trakt still couldn't match with just that one id - I have no idea why that is the case.
Even with the later patch that attempts to send all id's ##596 (comment)) it doesn't actually send anymore than the first one parsed due to how the plugin parses the Plex metadata and only reads the first one it encounters.

With my changes it now sends all the episode external id's that are returned in the Plex metadata, so imdb, tmdb, tvdb... etc are all sent across. Which for me, fixed all my shows (so far!)

Still hacking it with the scrobble part though, the data passed to scrobble.py should be correct before it reaches that far.

That's true, I probably could have just changed the build_episode bit .. which looking I failed to commit ... let me correct that on my end and update

I was testing out the previous patch and found I still had odd episodes not scrobbling. The more I investigated I could see they were generally those where a corresponding ID wasn't in Trakt e.g. Plex only had a tvdb and trakt only had the the tmdb. SO think this could be the cause of the odd ones never matching on scrobble.

Ok, I redid my change as per suggested. The patch isn't needed, instead I've updated the build_episode routine for the scrobbling request so that if the episode being played is a single episode it'll just use all of the ID's that the plex metadata returned.

For shows that are multipart it'll revert back to the current process so that the multiple episodes are scrobbled instead of just the one linked to the ID's. Becuase of this it's not 100% fool proof and if those shows fail to match on show name and episode number/name then it'll not scrobble those.

The main problems overall are as @p3lim pointed out, when playing an episode the plex metadata only contains most of the information about the episode, such as the episodes air date / year, instead of also providing enough details about the show itself. Which means trying to scrobble with trakt using show name / episode numbers isn't 100% reliable.
The main issue is that the external id's being returned when playing an episode only relate to the episode (or first episode in a multipart episode) and not the show.
So with the current plex metadata that I'm seeing on my own plex server, means we never have the show id's without additional calls to get metadata. - I'm not sure I have the python knowledge to adjust that to make additional calls to get show metadata alongside the episode metadata to fill it out more

Ok, I redid my change as per suggested. The patch isn't needed, instead I've updated the build_episode routine for the scrobbling request so that if the episode being played is a single episode it'll just use all of the ID's that the plex metadata returned.

So how to apply this now?

Ok, I redid my change as per suggested. The patch isn't needed, instead I've updated the build_episode routine for the scrobbling request so that if the episode being played is a single episode it'll just use all of the ID's that the plex metadata returned.

So how to apply this now?

Quickest way, just download the zip from my fork and replace your Trakttv.bundle plugin folder with the one you just downloaded.



After going away and spending a bit more time on it, I've improved my version so that it now pulls back the show metadata to get the external ids and year for the show, and passes it all along to Trakt as part of the scrobbling message.

So the scrobble message to trakt now looks something like:

{
    "app_date": None,
    "progress": 14.24,
    "app_version": "1.3.3",
    "show": {
        "title": "Hawkeye (2021)",
        "ids": {
            "imdb": "tt10160804",
            "tmdb": 88329,
            "tvdb": 367146
        },
        "year": 2021
    },
    "episode": {
        "season": 1,
        "number": 1,
        "title": "Never Meet Your Heroes"
    }
}

This should now mean that,

  1. the correct show is matched in trakt as I belive the ids take precendence over the show title when trakt is matching the show and now it's grabbing all the show ids and ignoring the episode ids.
  2. multipart episodes should now scrobble correctly again, there is already logic to figure out multipart episodes and which one to currently scrobble, so I've made sure it's still used as were now grabbing the correct show ids to send to trakt.
ricky commented

I installed the version from master in this repo, which contains the changes from #571, and it resolved the sync issues for me. Putting out a new release would probably help most people.

I installed the version from master in this repo, which contains the changes from #571, and it resolved the sync issues for me. Putting out a new release would probably help most people.

the new release is cornishman's fork i believe, i just downloaded the zip from the below link
https://github.com/Cornishman/Plex-Trakt-Scrobbler

Ok, I redid my change as per suggested. The patch isn't needed, instead I've updated the build_episode routine for the scrobbling request so that if the episode being played is a single episode it'll just use all of the ID's that the plex metadata returned.

So how to apply this now?

Quickest way, just download the zip from my fork and replace your Trakttv.bundle plugin folder with the one you just downloaded.

After going away and spending a bit more time on it, I've improved my version so that it now pulls back the show metadata to get the external ids and year for the show, and passes it all along to Trakt as part of the scrobbling message.

So the scrobble message to trakt now looks something like:

{
    "app_date": None,
    "progress": 14.24,
    "app_version": "1.3.3",
    "show": {
        "title": "Hawkeye (2021)",
        "ids": {
            "imdb": "tt10160804",
            "tmdb": 88329,
            "tvdb": 367146
        },
        "year": 2021
    },
    "episode": {
        "season": 1,
        "number": 1,
        "title": "Never Meet Your Heroes"
    }
}

This should now mean that,

  1. the correct show is matched in trakt as I belive the ids take precendence over the show title when trakt is matching the show and now it's grabbing all the show ids and ignoring the episode ids.
  2. multipart episodes should now scrobble correctly again, there is already logic to figure out multipart episodes and which one to currently scrobble, so I've made sure it's still used as were now grabbing the correct show ids to send to trakt.

does replacing the zip folder of "trakttv.bundle" require you to reconfigure any sort of Trakt settings, or is it plug and play once you replace the entire folder?

edit - i tried replacing the folder as is, and then trying to gain access to the trakt plugin using both Kitana and http://trakt-for-plex.github.io/configuration/#/connect ; now i can't access trakt in both environments. When i searched up some of the error messages ("Plex account is missing the server token"), i get the exact same issue as reported here: #335. I also tried rolling back to my old traktv.bundle folder i replaced, and i now still can't access trakt (did i just nuke my trakt plugin install?)

image

image

@Cornishman I was following another issue thread (#611), and it led me to this where @rg9400 wrote:

To fix this issue, you just need to use the version in this PR. It's unclear when it will be merged since the maintainers aren't around. It grabs the token automatically from the settings without any further user intervention needed.

Do you know if this means that the trakttv.bundle needs to be updated to potentially be able to pull the authentication token "PlexOnlineToken"?

EDIT: Hmm....while researching my error messages above, suddenly both interfaces (Kitana and web) are working again for me (I have Corningman's fork installed). But now i dont have real-time scrobbling working anymore, i start playing a movie or tv show and it doesn't immediately show the playback progress bar that used to be almost instant. But when i did run a full-sync on Kitana, the tv shows with a suffix (like "Foundation (2021)") showed up in my Continue Watching inside trakt.tv. So i know the plugin is syncing correctly with Trakt <-> Plex, but real-time scrobbling somehow isn't working anymore.

@Cornishman I was following another issue thread (#611), and it led me to this where @rg9400 wrote:

To fix this issue, you just need to use the version in this PR. It's unclear when it will be merged since the maintainers aren't around. It grabs the token automatically from the settings without any further user intervention needed.

Do you know if this means that the trakttv.bundle needs to be updated to potentially be able to pull the authentication token "PlexOnlineToken"?

@jeff15110168 Ah, I was not aware of this other issue. However I am now as I too have just encountered the same issue with the PlexOnlineToken being missing.

What I might do is create a seperate branch which also includes that fix so that users can grab a single trakttv.bundle with both fixes involved. I'll update you once I get around to doing that.

In the mean time an alternative solution is to download my branch and replace your existing trakttv.bundle directory, then once you've done that, to download/copy this file and replace the Trakttv.bundle/Contents/Libraries/Shared/plugin/modules/migrations/account.py file with this, which is the file with the PlexOnlineToken fix.

@Cornishman So I replaced with your code and I get a failure to scrobble. I tried then with a clean library, fresh set up of the plugin and imported one TV series using all defaults and the same occurs. Error I get in the Trakt log is:

2021-12-16 08:47:14,596 - plex_metadata.guid               (7fb3d1a79b38) :  WARNING (plex_metadata.guid:115) - Unsupported metadata agent: plex
2021-12-16 08:47:14,596 - plugin.scrobbler.methods.core.base (7fb3d1a79b38) :  WARNING (plugin.scrobbler.methods.core.base:14) - Unsupported guid: 'episode' (agent: 'plex')
2021-12-16 08:47:14,597 - plugin.scrobbler.methods.s_websocket (7fb3d1a79b38) :  INFO (plugin.scrobbler.methods.s_websocket:69) - No request returned for action 'start' (payload: {'part': 1, 'view_offset': 0, 'rating_key': 12})
2021-12-16 08:47:42,718 - plex.objects.core.base           (7fb3d1a79b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: grandparentguid
2021-12-16 08:47:42,719 - plex.objects.core.base           (7fb3d1a79b38) :  WARNING (plex.objects.core.base:156) - [Episode] Omitted attribute: parentguid
2021-12-16 08:47:42,720 - pyemitter                        (7fb3d1a79b38) :  WARNING (pyemitter:178) - [websocket.playing] Exception raised in: WebSocket.on_playing - 'list' object has no attribute 'valid'
Traceback (most recent call last):
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/pyemitter.py", line 175, in __call_sync
    callback(*args, **kwargs)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/methods/s_websocket.py", line 65, in on_playing
    view_offset=payload.get('view_offset')
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/methods/core/base.py", line 56, in build_request
    result = cls.build_episode(metadata, guid, part)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/methods/core/base.py", line 84, in build_episode
    ids = Identifier.get_ids(episode.guids, strict=False)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/identifier.py", line 22, in get_ids
    if guid and guid.valid and guid.service in GUID_SERVICES:
AttributeError: 'list' object has no attribute 'valid'

@the-jeffski Can I check, are you running a plex server version 1.22.3 or higher (which version?) and are you using the new Plex Scanner/Agents?
The old Agents/Scanners I believe won't work with this change as they don't do metadata in the same way.
image

The error seems to suggest an issue with the metadata Guid's attached to the epsiode, this could be because of the above not being configured, or it could be something else.
Any chance you can grab the xml from plex for the episode via the "Get Info" -> "View XML" option in plex, that would show what it's pulling back.
The bit we are focused on is the Guid nodes under the Video section.

<MediaContainer>
    <Video>
        <Media>
            <Part>
                ...
            </Part>
        </Media>
        <Guid id="imdb://tt10166574"/>
        <Guid id="tmdb://2670881"/>
        <Guid id="tvdb://8287132"/>
    </Video>
</MediaContainer>

@Cornishman Yes, so created brand new docker instance and its running Version 1.25.2.5319 .
Imported some files using the defaults so
image
And then connected trakt.
Play episode and the error orccurs. I put the full xml here https://pastebin.com/MNkA1CS9 . The library scan has picked up 3 ID's.

@the-jeffski My apologies, I apparently missed that change and failed to commit it to my branch originally. I have now corrected that issue hopefully, so if you download the latest master version from my fork this hopefully works a lot better for you.
Again sorry about that, was a very obvious oversight on my part! ๐Ÿ˜ž

Thanks so much Cornishman for your help on this! Is the latest master you referenced right above include the fix you were mentioning below? I somehow have lost the ability to realtime scrobble (only sync works) so hoping I can get that back up and running.

@jeff15110168 Ah, I was not aware of this other issue. However I am now as I too have just encountered the same issue with the PlexOnlineToken being missing.

What I might do is create a seperate branch which also includes that fix so that users can grab a single trakttv.bundle with both fixes involved. I'll update you once I get around to doing that.

@jeff15110168 Try this branch instead, direct zip link.
It's a separate branch that includes both my fix from here as well as the PlexOnlineToken fix pending in #615.

Let me know how you get on ๐Ÿ‘

@jeff15110168 Try this branch instead, direct zip link. It's a separate branch that includes both my fix from here as well as the PlexOnlineToken fix pending in #615.

Let me know how you get on ๐Ÿ‘

Installed this and fixed all my issues! Now real time scrobbling and sync work perfectly. Thank you so so much!!!

@jeff15110168 Try this branch instead, direct zip link. It's a separate branch that includes both my fix from here as well as the PlexOnlineToken fix pending in #615.

Let me know how you get on ๐Ÿ‘

Tested this branch and all working well for me too - all combinations of metadata working. God spot on the missed commit - happens to all of us!

@jeff15110168 Try this branch instead, direct zip link. It's a separate branch that includes both my fix from here as well as the PlexOnlineToken fix pending in #615.

Let me know how you get on ๐Ÿ‘

I can confirm that your patch is working for me! It's scrobbling again on-the-fly! ๐ŸŽ‰
Cheers, @Cornishman ! ๐Ÿฅ‡

Hello all,

First of all thanks for all the work with this fork and thanks @Cornishman.
I am new to plex and I can't figure how to made track to work with this plugin.
I have installed fork of @Cornishman, I have set it up (linking it to track.tv with the PIN), but now I can't seem to find any buttons or so to do a full sync between my plex server and track.tv. How do you guy's do that ?
In the plugin section i can only "configure" this track plugin but nothing else. No sync/pull option, etc.

Big thanks in advance.

BR

Hello all,

First of all thanks for all the work with this fork and thanks @Cornishman. I am new to plex and I can't figure how to made track to work with this plugin. I have installed fork of @Cornishman, I have set it up (linking it to track.tv with the PIN), but now I can't seem to find any buttons or so to do a full sync between my plex server and track.tv. How do you guy's do that ? In the plugin section i can only "configure" this track plugin but nothing else. No sync/pull option, etc.

Big thanks in advance.

BR

This should really be a new post if you need help. The FAQ answers all the setup steps and then the plugin will just run in the background on a sync schedule you have set.

Hello @the-jeffski,

Yes sure, while debugging the "absence" of connection with track I ended up here and though I would asked.
I'll create a new post with all the info. Thanks for confirming it's only a backround task with no possibility to trigger it manually.

BR

Been trying for 4 days to get this installed but it never seems to make a difference. Keep getting the same server token missing error. Have installed through webtools and manually and no dice. Literally deleted every instance of trakt from caches, log files etc and still nothing.

Running on unRaid

Mine has been running fine for around 2 years, no changes, but I'm now getting this server token missing error like @MagicSG1 is.

s1kee commented

I've also been getting an error with the token missing even with @Cornishman's fix :(

@Cornishman your updates seems mostly fine, and real-time scrobble works when I watch something in plex, I can see the live progress on trakt. However, it doesn't work as it used to, if I watch something outside of plex (on Kodi/other apps) which live scrobbles to trakt then plex doesn't show the real-time scrobble progress. It doesn't seem to show any partial watched content if watched outside of plex anymore, which it definitely used to. And I know the resume points have been saved on trakt, I use the trakt.tv playback progress manager. Do you know what is causing this, Is this fixable? Certainly would be handy to get that working again. Otherwise, plex does pull watched statuses just fine.

I would delete the existing package you have installed. The entire folder. And copy the new folder into your plugin folder

i believe this worked for me as well.
along with this.
#335 (comment)