示例#1
0
        public async static Task FetchYoutube(
            [ClArgs("watch", "w")]
            string[] watchs = null,
            [ClArgs("playlist", "pl")]
            string[] playlists = null,
            [ClArgs("outputDirectory", "dir")]
            string outputDirectory = null
            )
        {
            var youtubeDownloader = new YoutubeDownloader();

            if (outputDirectory != null)
            {
                youtubeDownloader.OutputDirectory = outputDirectory;
            }

            if (watchs != null)
            {
                foreach (var watch in watchs)
                {
                    await youtubeDownloader.FetchYoutube(watch);
                }
            }
            if (playlists != null)
            {
                foreach (var playlist in playlists)
                {
                    await youtubeDownloader.FetchYoutubePlaylist(playlist);
                }
            }
            Console.WriteLine("Downloads complete!");
        }
示例#2
0
        public static void FetchYoutube(
            [ClArgs("watch", "w")]
            string[] watchs = null,
            [ClArgs("playlist", "pl")]
            string[] playlists = null,
            [ClArgs("outputDirectory", "dir")]
            string outputDirectory = null
            )
        {
            var youtubeDownloader = new YoutubeDownloader();
            if (outputDirectory != null)
            { youtubeDownloader.OutputDirectory = outputDirectory; }

            if (watchs != null)
            {
                foreach (var watch in watchs)
                {
                    youtubeDownloader.FetchYoutube(watch);
                }
            }
            if (playlists != null)
            {
                foreach (var playlist in playlists)
                {
                    youtubeDownloader.FetchYoutubePlaylist(playlist);
                }
            }
            Console.WriteLine("Downloads complete!");
        }