Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Forgot to support sub only VODs
Browse files Browse the repository at this point in the history
  • Loading branch information
lay295 committed Jan 13, 2021
1 parent bc9208b commit 0377ada
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TwitchDownloaderCore/TwitchHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public static async Task<JObject> GetVideoToken(int videoId, string authToken)
{
client.Encoding = Encoding.UTF8;
client.Headers.Add("Client-ID", "kimne78kx3ncx6brgo4mv6wki5h1ko");
if (authToken != null && authToken != "")
client.Headers.Add("Authorization", "OAuth " + authToken);
string response = await client.UploadStringTaskAsync("https://gql.twitch.tv/gql", "{\"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\":false,\"login\":\"\",\"isVod\":true,\"vodID\":\"" + videoId + "\",\"playerType\":\"embed\"}}");
JObject result = JObject.Parse(response);
return result;
Expand Down

0 comments on commit 0377ada

Please sign in to comment.