Beispiel #1
0
        private async void MaterialFlatButton2_Click(object sender, EventArgs e)
        {
            var    client = new YoutubeClient();
            string link   = SearchBoxInput.Text;
            string id     = YoutubeClient.ParseVideoId(link);

            var video = await client.GetVideoAsync(id);

            var title     = video.Title;
            var author    = video.Author;
            var duration  = video.Duration;
            var desc      = video.Description;
            var thumbnail = video.Thumbnails.HighResUrl;
            var views     = video.Statistics.ViewCount;
            var likes     = video.Statistics.LikeCount;
            var dislikes  = video.Statistics.DislikeCount;
            var keywords  = video.Keywords;

            materialLabel1.Text  = title;
            materialLabel2.Text  = author;
            materialLabel3.Text  = duration.ToString();
            materialLabel7.Text  = views.ToString() + " views";
            textBox1.Text        = desc;
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            pictureBox1.Load(thumbnail);
            textBox2.Text = "";
            foreach (string keyword in keywords)
            {
                textBox2.Text = textBox2.Text + keyword + ", ";
            }
            materialLabel4.Text = "Likes - " + likes + " Dislikes - " + dislikes;


            SaveThumbnailCheckBox.Show();
        }