Jump to content

Trakt full sync problem


parsaria

Recommended Posts

parsaria

Could it be possible that a single item is interpreted differently by trakt according the date time format and an array more strictly??

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON

We really should at least try the suggested Datetime format according the guide lines.

 

I also saw that we are using https://api-v2launch.trakt.tv, but IO don't see that URI suggested any more, I think the new URI should be https://api.trakt.tv.

Link to comment
Share on other sites

parsaria

Ok, i just watched a TVshow with all the debugging on.

And i found out why it works right with a just watched TVshow/Movie.

 

at the start of playing the plugin issues the folowing REST command to Trakt

https://api-v2launch.trakt.tv/scrobble/start  {"episode":{"ids":{"tvdb":6076428}},"progress":0,"app_version":"3.2.24.0","app_date":"2017-07-10"}
 

at the end of watch episode the plugin issues the folowing REST command to Trakt

https://api-v2launch.trakt.tv/scrobble/stop {"episode":{"ids":{"tvdb":6076428}},"progress":100,"app_version":"3.2.24.0","app_date":"2017-07-10"}
 
So a just watched movie/episode does not work like the history system like the sync but with the scrobble system.
 
Acording to the API manual when a https://api-v2launch.trakt.tv/scrobble/stop is called the following happens, thus giving the Episode/Movie a watch timestamp.
Note: If the same item was just scrobbled, a 409 HTTP status code will returned to avoid scrobbling a duplicate. The response will contain a watched_at timestamp which is when the item was last scrobbled.
Edited by parsaria
Link to comment
Share on other sites

Angelblue05

I'm not very good at C#... some things I don't understand. I played with the plugin for a few hours trying to debug. It sees correctly what needs to be marked as watched in trakt. But it would not return anything as being added... it's really strange. I cut out the middle man and tried in apiary... same result with my trakt user auth.

 

 

Sent from my iPhone using Tapatalk

Edited by Angelblue05
Link to comment
Share on other sites

parsaria

That was exactly my experience as well.

 

Tried microseconds, other Uri.

i also debugged the real response it just not adding the watched status.

There is also an other possibility we could try, 

in the manual:

item * object movie, show, or episode object. watched_at datetime UTC datetime when the item was watched. Set to released to automatically use the initial release date.

We can also give a "released" instead of datetime to see if that works, just an idea.

Link to comment
Share on other sites

parsaria

"released" string also not working, the only thing i came across are traktid, everywhere in the exmaples of historysync there is a trakttid, maybe that is the missing ling somehow they realy want you to use the traktid for updating watched history.

 

But right now there now where in the code we can get a traktid.

Link to comment
Share on other sites

Angelblue05

I think I found something. I just saw the inspector tab in the trakt apiary. 

 

Look what it says:

{
"movies": [

    {

    "watched_at": "2017-07-10T03:37:12Z"

    "title": "Resident Evil: The Final Chapter"

    "year": 2017

    "ids":     {

      "imdb": "tt2592614"

      "tmdb": 173897

}
}
]
}
At '/shows' Missing required property: shows
At '/episodes' Missing required property: episodes
At '/movies/0/ids/trakt' Missing required property: trakt
At '/movies/0/ids/slug' Missing required property: slug

So we need to fix that. I will check into it later today.

 

 

Edit: I've repeated the test in the apiary with all the data... no luck, it still doesn't mark stuff as watched! This time, there's no errors. :(

Edited by Angelblue05
Link to comment
Share on other sites

parsaria

I think there fundamentally something wrong with this plug-in it uses old login and, with the tolerance of scrobble still working with this.

 

In the Apiary of trakt there is no trace of "/auth/login" as a login style, also the use of these headers are not supported anymore "trakt-user-login", "trakt-user-token". both of these methods are used in this plug-in.

I strongly suggest to rewrite this plug-in with the use of https://henrikfroehling.github.io/TraktApiSharp/ this i full C# library to use with Trakt.tv API with the use of OAuth.

 

I think otherwise we end up with investing a lot of time in something that is never going to work the right way eventually.

 

Or am i missing something here?

Link to comment
Share on other sites

Check the plugin xml config file. It will use whatever login information is in that file. thanks !

Link to comment
Share on other sites

parsaria

The XML is not the problem here, the real problem is that there should be OAUTH or Device authorization to make this function to work.

The fact the the progress function is still working is that trakt.tv is still tolerating the old authorization on that method.

Because even that method is OAUTH required so it is a matter of time that they don't tolerate that one anymore.

 

I understand c# and henrikfroehling's library is not that bad but that mean you have the rewrite the whole API part of the plug-in to use his library, and that is not something that i can make any decision about.

 

But working on the current API of plug-in or trying to fix it is a lost cause.

 

But that is the way i am understanding this problem.

Link to comment
Share on other sites

parsaria

No you can not request OAUTH  withouth the APPsecret with the current appid.

So to get it towork you need to make your own APP id and secret.

So before you can make sync/history request you need to make /oauth/token request so you get your access_token, that access_token has to be refreshed before every 3 months.

 

But i am going to write a simple console c# app with the use of henrikfroehling's lib and my own APP with ID and secret and try to make it work from there, so i got an base to start with.

Yet again that is only for my own purpose only because i am interested how trakt works, but for a real implementation decision have to be made.

Link to comment
Share on other sites

  • 4 weeks later...

So this is broken for now then? mine is still pointing to the incorrect address. 'api-v2launch.trakt.tv'

 

What exactly do you think is broken?

Link to comment
Share on other sites

Angelblue05

In my case, nothing syncs to trakt. It acts like it works, but the plugin gets no confirmation response from trakt, therefore something is not right.

I can only sync what I watch to trakt via the scrobble. Marking stuff as watched to be added to trakt is completely broken.

 

The api for trakt that's in the plugin is outdated. The url and authentication are outdated. But when I tested directly on trakt, bypassing Emby entirely, I could not get it to work either. So I'm guessing, something with the authentication is just not right (I copied the authentication method used in the plugin). Scrobble probably still works because it's backward compatible with the older api, but the rest is not.

Edited by Angelblue05
Link to comment
Share on other sites

Trevor68

What exactly do you think is broken?

Everything, plugin just says the link does not exist now

 

Sent from my ZTE B2015 using Tapatalk

Link to comment
Share on other sites

Everything, plugin just says the link does not exist now

 

Sent from my ZTE B2015 using Tapatalk

 

Where does it say link does not exist? What do you mean by everything?

Link to comment
Share on other sites

Trevor68

Well I imagine no functions of the plugin are working given the link is wrong? Am I wrong to assume so?

Emby Server messages are telling me trak fails to sync because that link does not exist.

 

People in this thread have confirmed its the wrong link, so therefore I have imagined something needs fixing?

 

Of course it could all be a dream, hence my asking :-)

Edited by Trevor68
Link to comment
Share on other sites

Trevor68

In my case, nothing syncs to trakt. It acts like it works, but the plugin gets no confirmation response from trakt, therefore something is not right.

I can only sync what I watch to trakt via the scrobble. Marking stuff as watched to be added to trakt is completely broken.

 

The api for trakt that's in the plugin is outdated. The url and authentication are outdated. But when I tested directly on trakt, bypassing Emby entirely, I could not get it to work either. So I'm guessing, something with the authentication is just not right (I copied the authentication method used in the plugin). Scrobble probably still works because it's backward compatible with the older api, but the rest is not.

 

Confirming Scrobble does still work and you are correct, nothing else does.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
Trevor68

The error has changed since the plugin was updated 12 hours ago.

 

"Method not found: 'Boolean MediaBrowser.Controller.Entities.TV.Episode.get_IsVirtualUnaired()'."

Link to comment
Share on other sites

The error has changed since the plugin was updated 12 hours ago.

 

"Method not found: 'Boolean MediaBrowser.Controller.Entities.TV.Episode.get_IsVirtualUnaired()'."

 

The latest update to the plugin resolves that, thanks.

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...