private async static Task DownloadFilesAsync(ClipInfo clip) { WebClient client = new WebClient(); string url = GetClipURL(clip); string filepath = data.OutputPath + clip.id + ".mp4"; await client.DownloadFileTaskAsync(new Uri(url), filepath); }
private static string GetClipURL(ClipInfo clip) { // Example thumbnail URL: // https://clips-media-assets2.twitch.tv/AT-cm%7C902106752-preview-480x272.jpg // You can get the URL of the location of clip.mp4 // by removing the -preview.... from the thumbnail url */ string url = clip.thumbnail_url; url = url.Substring(0, url.IndexOf("-preview")) + ".mp4"; return(url); }