-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tv shows not scrobbling with new scanner/agent #596
Comments
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:
and this is the metadata when using the new Plex TV Scanner
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
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! |
Thanks, this worked for me! |
Running
I have since purchased Plex Pass and Trakt VIP and enabled scrobbling using webhooks. Thank you everyone for your help! |
Yes, all three XMLs have the proper
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.
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'm only using the scrobble function so I haven't tested syncing.
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.
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?
|
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:
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: 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... 😅 |
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: |
@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! |
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. |
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):
After manually removing the year from the title of the show:
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. 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. |
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 |
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? |
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:
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:
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, |
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. |
So how to apply this now? |
Quickest way, just download the zip from my fork and replace your
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,
|
the new release is cornishman's fork i believe, i just downloaded the zip from the below link |
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?) |
@Cornishman I was following another issue thread (#611), and it led me to this where @rg9400 wrote:
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. |
@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 What I might do is create a seperate branch which also includes that fix so that users can grab a single In the mean time an alternative solution is to download my branch and replace your existing |
@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:
|
@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 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. <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 . |
@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. |
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 Try this branch instead, direct zip link. 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!!! |
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! |
I can confirm that your patch is working for me! It's scrobbling again on-the-fly! 🎉 |
Hello all, First of all thanks for all the work with this fork and thanks @Cornishman. 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. BR |
You are prob best posting on the plex forum
https://forums.plex.tv/t/rel-trakt-tv/60847 as its help you are after
rather than a bug.
…On Tue, Dec 28, 2021 at 4:04 PM Amaury Tinard ***@***.***> wrote:
Hello @the-jeffski <https://github.com/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
—
Reply to this email directly, view it on GitHub
<#596 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APEOZL7QZDNCOOGNQETK2RDUTHNXDANCNFSM437Q2Z2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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. |
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 believe this worked for me as well. |
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.
The text was updated successfully, but these errors were encountered: