Ejemplo n.º 1
0
        public async Task <JSON_Vimeo> GetVimeoDownloadUrls(string VimeoVideoUrl)
        {
            using (HtpClient localHttpClient = new HtpClient(new HCHandler()))
            {
                HttpResponseMessage ResPonse = await localHttpClient.GetAsync(new Uri(string.Format("https://player.vimeo.com/video/{0}/config", VimeoVideoUrl.Split('/').Last()))).ConfigureAwait(false);

                var result = await ResPonse.Content.ReadAsStringAsync();

                if (ResPonse.IsSuccessStatusCode)
                {
                    var fin = JsonConvert.DeserializeObject <JSON_Vimeo>(result, JSONhandler);
                    foreach (var vid in fin.request.files.progressive)
                    {
                        vid.Size_str = await Utilitiez.GetFileSize(vid.url);
                    }
                    return(fin);
                }
                else
                {
                    ShowError(result);
                    return(null);
                }
            }
        }