Merhaba,
Burp ile yakaladığım bu isteği
POST /gql HTTP/1.1
Host: gql.twitch.tv
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0
Accept: */*
Accept-Language: en-US
Accept-Encoding: gzip, deflate
Referer: https://www.twitch.tv/
Authorization: undefined
Client-Id: kimne78kx3ncx6brgo4mv6wki5h1ko
Content-Type: text/plain; charset=UTF-8
Device-Id: NtXpW8epoqljzbWnqhgSEuLkKXK1TEfe
Origin: https://www.twitch.tv
Content-Length: 665
Dnt: 1
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
Pragma: no-cache
Cache-Control: no-cache
Te: trailers
Connection: close
{"operationName":"PlaybackAccessToken_Template",
"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 __typename } videoPlaybackAccessToken(id: $vodID, params: {platform: \"web\", playerBackend: \"mediaplayer\", playerType: $playerType}) @include(if: $isVod) { value signature __typename }}",
"variables":{
"isLive":true,
"login":"tingirifistik",
"isVod":false,
"vodID":"",
"playerType":"site"}}
nasıl requests kütüphanesi ile post isteği olarak gönderebilirim?
import requests
data = {"operationName":"PlaybackAccessToken_Template","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 __typename } videoPlaybackAccessToken(id: $vodID, params: {platform: \"web\", playerBackend: \"mediaplayer\", playerType: $playerType}) @include(if: $isVod) { value signature __typename }}","variables":{"isLive":True,"login":"tingirisssdfistik","isVod":False,"vodID":"","playerType":"site"}}
header = {
"Host": "gql.twitch.tv",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0",
"Accept": "*/*",
"Accept-Language": "en-US",
"Accept-Encoding": "gzip, deflate",
"Referer": "https://www.twitch.tv/",
"Authorization": "undefined",
"Client-Id": "kimne78kx3ncx6brgo4mv6wki5h1ko",
"Content-Type": "text/plain; charset=UTF-8",
"Device-Id": "NtXpW8epoqljzbWnqhgSEuLkKXK1TEfe",
"Origin": "https://www.twitch.tv",
"Content-Length": "665",
"Dnt": "1",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-site",
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"Te": "trailers",
"Connection": "close"
}
a = requests.post("https://gql.twitch.tv/gql", data=data, headers=header)
print(a.status_code)
Bu kodu denedim ama olmadı.