Skip to content

Fix Twitch StreamMetadata persisted query hash rotation#1009

Open
ShinysArc wants to merge 1 commit into
glanceapp:mainfrom
ShinysArc:fix/twitch-stream-metadata-persisted-query
Open

Fix Twitch StreamMetadata persisted query hash rotation#1009
ShinysArc wants to merge 1 commit into
glanceapp:mainfrom
ShinysArc:fix/twitch-stream-metadata-persisted-query

Conversation

@ShinysArc
Copy link
Copy Markdown

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".
Fix was to update to the current hash sourced from streamlink which tracks Twitch GQL API changes.

Also added the required includeIsDJ variable, otherwise we get a Variable \"includeIsDJ\" has invalid value null.\nExpected type \"Boolean!\", found null error.

Verified by curling https://gql.twitch.tv/gql directly, old hash returns PersistedQueryNotFound, new hash returns valid stream metadata.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant