Since Twitch decomissioned API V5, there's no correct way to get the VOD offset for a clip. So I just inspected what the Twitch web app was doing and came up with a super cool hack.
I know this looks really complicated but really it just does two things. First it gets the clip information from the official API, then it uses Twitch GraphQL API to get the offset.
kimne78kx3ncx6brgo4mv6wki5h1ko
is the Client ID that the Twitch web app uses. It can be used to access Twitch's GraphQL API (undocumented & not for public use). The postData
variable contains a request and a sha256Hash
. The sha256Hash
is basically a job ID and may change in the future, but I added the current hash which should work for all clips as of posting this.
const clientId = "" // Put your Twitch Client ID here
const clientSecret = "" // Put your Twitch Client Secret here