public static void GetplaylistInfo(YouTubePlaylist playlist) // Get title of playlist by ID { var playlistRequest = ytService.Playlists.List("snippet"); // "contentDetails"? playlistRequest.Id = playlist.id; // or .userID? var respose = playlistRequest.Execute(); if (respose.Items.Count > 0) { playlist.title = respose.Items[0].Snippet.Title; //video.description = respose.Items[0].Snippet.Description; } else { // playlist ID not found MessageBox.Show("Error in retrieving current playlist's data"); } }
public void GetPlaylistData(YouTubePlaylist myPlaylist) { YouTubeVideo[] videos = YouTubeAPI.GetPlaylist(myPlaylist.id); // lists all titles of videos of a playlist (via each video ID) string missingVideoTitle; for (int i = 0; i < videos.Length; i++) { if (videos[i].title == null) { missingVideoTitle = ExcelHandling.SearchMissingVideo(i + 1, myPlaylist.title, videos.Length); MissingVideo missingVideo = new MissingVideo((i + 1).ToString() + ": " + missingVideoTitle, myPlaylist.title); myMissingVideos.Add(missingVideo); } } labelCurrentPlaylist.Visible = true; labelCurrentPlaylist.Text = "Currently Processing: " + myPlaylist.title; ExcelHandling.SaveCurrentPlaylistToSheet(myPlaylist.title, videos); labelCurrentPlaylist.Visible = false; }