
Private CookieContainer GetCookieContainerPerThread() If (response2.StatusCode = HttpStatusCode.Found) Using (HttpWebResponse response2 = GetResponse(req)) String videoUrl = string.Format("&quality=hd&codecs=H264,VP8,VP6&type=moogaloop_local&embed_location=", clipId, sig, timestamp) String timestamp = Regex.Match(pageData, "\"timestamp\":(\\d+)", RegexOptions.Singleline).Groups.ToString() String sig = Regex.Match(pageData, "\"signature\":\"(.+?)\"", RegexOptions.Singleline).Groups.ToString() If (Regex.Match(pageData, RegexOptions.Singleline).Success)ĬlipId = Regex.Match(pageData, RegexOptions.Singleline).Groups.ToString() Įlse if (Regex.Match(pageData, RegexOptions.Singleline).Success) String pageData = new StreamReader(response.GetResponseStream()).ReadToEnd() Using (HttpWebResponse response = GetResponse(req)) Req.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate Req.Accept = "text/html,application/xhtml+xml,application/xml q=0.9,*/* q=0.8" Private void Button_Click(object sender, RoutedEventArgs e) Here is code-behind: private Dictionary m_cookieContainer = new Dictionary() I created new WPF project with simple button. Return "error: server returned status description:" + response.StatusDescription If (response.StatusCode = HttpStatusCode.Found) StreamReader reader = new StreamReader(responseStream, Encoding.UTF8) Stream responseStream = response.GetResponseStream() If (response.StatusCode = HttpStatusCode.OK) HttpWebResponse response = (HttpWebResponse)request.GetResponse() įoreach (Cookie cookie in response.Cookies) Request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate Request.Accept = "text/html,application/xhtml+xml,application/xml q=0.9,*/* q=0.8" HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url) Public string GetHttpSpecial(string url, CookieContainer cookies) _VideoURL = GetHttpSpecial(url, cookies) This is the code: string url = "" + clip_id + "&sig=" + request_signature + "&time=" + request_signature_expires + "&quality=" + hd + "&codecs=H264,VP8,VP6&type=moogaloop_local&embed_location=" The problem is that I receive the code 200 (with a page that says "Permision denied") when I have to receive de code 302 to do a redirection. I'm trying to download videos from vimeo) with c#.
