public void Run()
 {
     // Custom Youtube
     var youtube = new CustomYouTube();
     var foo1    = youtube.GetAllVideosAsync("https://www.youtube.com/watch?v=qK_NeRZOdq4").GetAwaiter().GetResult();
     var video   = foo1.ToList().FirstOrDefault();
     var byte1   = video.GetBytesAsync().GetAwaiter().GetResult();
     // Custom youtube with custom client
     var client = new CustomYoutubeClient();
     var byte2  = client.GetBytesAsync(video).GetAwaiter().GetResult();
 }
        public void Run()
        {
            // Custom Youtube
            var youtube       = new CustomYouTube();
            var videos        = youtube.GetAllVideosAsync("https://www.youtube.com/watch?v=qK_NeRZOdq4").GetAwaiter().GetResult();
            var maxResolution = videos.First(i => i.Resolution == videos.Max(j => j.Resolution));

            youtube
            .CreateDownloadAsync(
                new Uri(maxResolution.Uri),
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), maxResolution.FullName),
                new Progress <Tuple <long, long> >((Tuple <long, long> v) =>
            {
                var percent = (int)((v.Item1 * 100) / v.Item2);
                Console.Write(string.Format("Downloading.. ( % {0} ) {1} / {2} MB\r", percent, (v.Item1 / (double)(1024 * 1024)).ToString("N"), (v.Item2 / (double)(1024 * 1024)).ToString("N")));
            }))
            .GetAwaiter().GetResult();
        }