-
Notifications
You must be signed in to change notification settings - Fork 216
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
Oauth refresh on request #403
Conversation
You can easily fix this by extending |
Thank you for your comments. I think i managed to come up with something that works better. I also updated the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pretty close to a good solution, although still some optimizations to be had
…usicapi into oauth-refresh-on-request
…musicapi into oauth-refresh-on-request
…musicapi into oauth-refresh-on-request
I hope that the last fix makes the test run. I also don't know why these commits with merges keeps coming. they seem to be from another fork or something. git wouldn't let me push if i didn't pull stuff that i didn't even change in the first place.. anyway, thanks again for your comments. I think they really improved the funcionality. |
This does it. Thanks for the persistence. No worry about the commits, they get squashed anyway |
* updating token on every request if auth is oauth * remove print line * headers only updated if auth is oauth * some refactoring * dont know what happened here * check for self.auth --------- Co-authored-by: simon <[email protected]>
This fix should update so that for every request to ytmusic the code checks if the access token needs refreshing and refreshes it if that's the case.
However, the headers object are updated on every request, regardless if the token needs refreshing or not. This is probably not cpu heavy by any means but should perhaps be looked at in another iteration. or when i have more time...