From 584f309bd7b88221a7c80d67dc3a7235be9be024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gelibert?= Date: Wed, 13 May 2026 03:44:24 +0200 Subject: [PATCH] Fix Twitch StreamMetadata persisted query hash rotation Twitch rotated the persisted query hash for StreamMetadata, causing the old hash to return PersistedQueryNotFound with no `data` field, which then triggered `json.Unmarshal(nil, ...)` -> "unexpected end of JSON input". Update to the current hash and add the required `includeIsDJ` variable. Hash sourced from streamlink which tracks Twitch GQL API changes. --- internal/glance/widget-twitch-channels.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/glance/widget-twitch-channels.go b/internal/glance/widget-twitch-channels.go index 1290a265f..7bf6841d6 100644 --- a/internal/glance/widget-twitch-channels.go +++ b/internal/glance/widget-twitch-channels.go @@ -121,7 +121,7 @@ type twitchStreamMetadataOperationResponse struct { const twitchChannelStatusOperationRequestBody = `[ {"operationName":"ChannelShell","variables":{"login":"%s"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"580ab410bcd0c1ad194224957ae2241e5d252b2c5173d8e0cce9d32d5bb14efe"}}}, -{"operationName":"StreamMetadata","variables":{"channelLogin":"%s"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"676ee2f834ede42eb4514cdb432b3134fefc12590080c9a2c9bb44a2a4a63266"}}} +{"operationName":"StreamMetadata","variables":{"channelLogin":"%s","includeIsDJ":true},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"b57f9b910f8cd1a4659d894fe7550ccc81ec9052c01e438b290fd66a040b9b93"}}} ]` // TODO: rework