public void FetchYoutubePlaylist(string playlistToken) { var factory = new YoutubePlaylistFactory(); var playlist = factory.DownloadPlaylist(playlistToken); Console.WriteLine("Downloading {0} videos from playlist.", playlist.items.Length); foreach (var videoUrl in playlist.items.Select(i => i.contentDetails.videoId)) { FetchYoutube(videoUrl); } }
public async Task FetchYoutubePlaylist(string playlistToken) { var factory = new YoutubePlaylistFactory(); var playlist = await factory.DownloadPlaylist(playlistToken); Console.WriteLine($"Downloading {playlist.Videos.Length} videos from playlist."); foreach (var videoUrl in playlist.Videos.Select(i => i.Id)) { await FetchYoutube(videoUrl); } }