示例#1
0
        public IActionResult GetVideo(string YoutubeUrl)
        {
            _logger.LogInformation("Downloading from " + YoutubeUrl);
            if (!Uri.IsWellFormedUriString(YoutubeUrl, UriKind.Absolute))
            {
                return(BadRequest("Invalid URL"));
            }

            var youtubedlConfig = _appSettings.YoutubeDLConfig;

            Task.Run(() => _commander.RunYoutubeDL(YoutubeUrl, youtubedlConfig));
            return(Ok("Process started for " + YoutubeUrl + " using config " + youtubedlConfig));
        }