umbrellaplug / umbrellaplug.github.io

Umbrella Kodi Addon Official
115 stars 17 forks source link

Reauthorize Trakt on Ezra popup after watching episode with Umbrella on my TV Collection #6

Closed cg00001 closed 2 years ago

cg00001 commented 2 years ago

I don't know if another popup would follow about reauthorizing Umbrella, because I quickly recovered Trakt logins from my wizard, Resynced, and rebooted twice to see if the issue was fixed, so Kodi.log and Kodi.old.log were clean. Works good so far. I'll be alert and I'll enable debug log and get a log for you if it happens again.

Ezra-Hubbard commented 2 years ago

because I quickly recovered Trakt logins from my wizard

When you say recovered from a wizard, do you mean some sort of backup manager or build creator?

With trakt especially (and debrid), the best route is always to reauthorise as the way things are handled can change (as it did recently in my accounts) and you may not get the results you expect

cg00001 commented 2 years ago

because I quickly recovered Trakt logins from my wizard

When you say recovered from a wizard, do you mean some sort of backup manager or build creator?

With trakt especially (and debrid), the best route is always to reauthorise as the way things are handled can change (as it did recently in my accounts) and you may not get the results you expect

The wizard I use saves logins, and when I Recover eg Trakt logins (after Revoking Trakt in My Accounts) it just puts the login in My Accounts, then I have to Resync.

Of course I'll revoke and reauthorize from My Accounts as my next step, after getting a proper log.

umbrellaplug commented 2 years ago

Please try latest version of Umbrella. Revoke Trakt > Re-Authorize. Go to each plugin Ezra, Umbrella, and whatever else uses my accounts and make sure to access the "my account" option from settings in each plugin to make sure they have all "synced". In Umbrella you should see a "Umbrella has syned with My Accounts" popup, I'm not sure about Ezra.

cg00001 commented 2 years ago

So far so good, I'm closing this, will drop a comment if it happens again.

umbrellaplug commented 2 years ago

Kingpin and Umbrella are causing tons of re-auth errors in the background. Both Umbrella and Kingpin are missing "trakt.expires" in their setting definitions.

cg00001 commented 2 years ago

It happened again a while ago, before that I revoked, authorized, and resynced as you mentioned, but updates happened after Revoking. Revoked again and will see how it goes. See lines from 1483 to 1486. kodi.log

umbrellaplug commented 2 years ago

Yeah, I'm really sorry everyone keeps having issues with this. I should have caught it sooner. I will say though.... it's not my fault.

Very long story short, it's fixed now. Trakt was sending us back some junk responses on some lists that were coded as a "401", to us 401 means "yep. gotta refresh this token"

When we did that refresh, it would then try the same call that had failed before, but it would fail again... Because trakt had it setup to return 401.

I've added code in the getTrakt module that will ignore a 401 if it has a label of "private-user" : "true" in the response headers. We have tracked that back to being the issue. Trakt is returned 401 for some user lists. (It shouldn't be, but that's not really my place to say)

Once again, any venom clone will need this fix, If it hasn't been patched and you try to run it, this issue is going to come up again.

It's fixed in Umbrella 6.5.31, which is available now.

umbrellaplug commented 2 years ago

@Wilson-Fisk Please make sure you get this changed in Kingpin. I'm concerned about the key for My Accounts getting flagged.

Wilson-Fisk commented 2 years ago

@Wilson-Fisk Please make sure you get this changed in Kingpin. I'm concerned about the key for My Accounts getting flagged.

They were just added about 45 minutes ago! (I believe, feel free to check my work)

Edit: wait 401 changes have not been added yet, give me 20 minutes

umbrellaplug commented 2 years ago

https://github.com/umbrellaplug/umbrellaplug.github.io/commit/fba4ec7474f828eaf39de8b5d2e915d3398121a4

The trakt.py changes are muy importante.

umbrellaplug commented 2 years ago

@Ezra-Hubbard By the way..... lol I'm 100% sure you don't want to read this one, but this MAY be effecting you also. I haven't looked into it a whole bunch due to trying to make sure it got fixed on our side because of the obvious problem. I did a quick search in the ezra code for 401 and sure enough it's in the trakt_api.py module. If I get some time. I'll try it out. I was able to easily see it by adding some logging into umbrella on trakt calls and whenever i get a 401 I logged out the repsonse.header to see if private-user :true was present. If so, it's a not really a valid 401 and should not be going into any re-auth functions.

Wilson-Fisk commented 2 years ago

@umbrellaplug pushing now, so this change can cause some lists to not sync?

umbrellaplug commented 2 years ago

@umbrellaplug pushing now, so this change can cause some lists to not sync?

Yeah, just the ones marked incorrectly private by trakt. Beats re-authenticating until our Trakt keys blow up. Look, I know this is annoying, but need to grab the last change i made too. I got some good help from a guy in the forums about this and I was on the right path but in python response[0].headers could return an error. response.headers.get() will not.

Wilson-Fisk commented 2 years ago

@umbrellaplug pushing now, so this change can cause some lists to not sync?

Look, I know this is annoying, but need to grab the last change i made too. I got some good help from a guy in the forums about this and I was on the right path but in python response[0].headers could return an error. response.headers.get() will not.

That's alright, I'll add those changes in in a bit