Comments (6)
Some more details, since this stops working after some time I would expect authentication to be the main issue.
HA is handling the OAuth handshake itself, since it needs to keep track of the current token, so using client.auto_refresh_auth = False
.
Problem is that the call doesn't fail, but just return without the total
field present. I would have expected some kind of authentication error exception.
from pytwitchapi.
hm that should still raise an exception, thanks for the further investigation!
from pytwitchapi.
It gets more strange. I changed the code to actually refresh the token when it expired and I still get the same error.
I get this at startup.
2024-03-09 00:23:40.582 DEBUG (MainThread) [homeassistant.components.twitch.sensor] Token: {'access_token': 'whr8pbvgcy61jupn0harp5aqd02eh3', 'expires_in': 15759, 'refresh_token': 'f56blnott4u856pwlay1sxrvxbsdlu9vg5v7mn4olhf0cnkz0d', 'scope': ['user:read:follows', 'user:read:subscriptions'], 'token_type': 'bearer', 'expires_at': 1709954343.5376744}
Couple of hours later the log shows the above problem, with this auth, so it did indeed do a token refresh.
2024-03-09 00:29:38.069 DEBUG (MainThread) [homeassistant.components.twitch.sensor] Token: {'access_token': 'whr8pbvgcy61jupn0harp5aqd02eh3', 'expires_in': 15759, 'refresh_token': 'f56blnott4u856pwlay1sxrvxbsdlu9vg5v7mn4olhf0cnkz0d', 'scope': ['user:read:follows', 'user:read:subscriptions'], 'token_type': 'bearer', 'expires_at': 1709954343.5376744}
The log is complaining about that total
error at that stage again.
I restarted Home Assistant, and the error went away. With the exact same token I used before the restart!?!?!
So not sure it even IS related to auth?
from pytwitchapi.
Meanwhile I have fixed the bug in Home Assistant that exposed the problem. It was indeed a token refresh bug.
from pytwitchapi.
Related Issues (20)
- [Question] 1 Time Authentication HOT 2
- UserAuthenticationStorageHelper: Implicit Grant Flow support
- Reply no longer works HOT 1
- EventSub stop() RuntimeError difference between Webhook and Websocket HOT 1
- EventSub Websocket failing to reconnect HOT 3
- Add Device Code Flow
- Implement Conduit support
- Keepalive missed / reconnecting
- Add "Channel Chat Settings Update" topic
- Add new Endpoint "Get User Emotes"
- Add new Unban Requests related topics
- Add new Automod related topics
- create_clip throws an exception when passed a stream that doesn't allow clipping
- New Endpoint: Channel Points Automatic Reward Add
- Add new VIP related topics
- Add new topic "User Whisper Message"
- Update Get User Emotes Endpoint to reflect API changes
- Expand supported EventSub status messages on related Endpoints HOT 1
- Add new Suspicious User related topics
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytwitchapi.