~shockham/witcht

8b6a45670dc1e4e99c820751cac5b6da63a320e4 — shockham 3 months ago f7acb62 main
fix: simplify to just changing to using https to get stream url
1 files changed, 7 insertions(+), 2 deletions(-)

M main.go
M main.go => main.go +7 -2
@@ 19,7 19,7 @@ import (
type Operation string

const (
	PlaybackAccessToken Operation = "PlaybackAccessToken_Template"
	PlaybackAccessToken Operation = "PlaybackAccessToken"
)

const (


@@ 34,7 34,12 @@ const (
func QueryGQL(operationName Operation, channel string, variables interface{}) (*http.Response, error) {
	values := map[string]interface{}{
		"operationName": operationName,
		"query": `query PlaybackAccessToken_Template($login: String!, $isLive: Boolean!, $vodID: ID!, $isVod: Boolean!, $playerType: String!) {  streamPlaybackAccessToken(channelName: $login, params: {platform: "web", playerBackend: "mediaplayer", playerType: $playerType}) @include(if: $isLive) {    value    signature   authorization { isForbidden forbiddenReasonCode }   __typename  }  videoPlaybackAccessToken(id: $vodID, params: {platform: "web", playerBackend: "mediaplayer", playerType: $playerType}) @include(if: $isVod) {    value    signature   __typename  }}`,
		"extensions": map[string]interface{}{
			"persistedQuery": map[string]interface{}{
				"version":    1,
				"sha256Hash": "0828119ded1c13477966434e15800ff57ddacf13ba1911c129dc2200705b0712",
			},
		},
		"variables": variables,
	}