コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }