Пример #1
0
        private R <PlayResource> YoutubeDlWrapped(string link)
        {
            Log.Write(Log.Level.Debug, "SC Ruined!");

            var result = YoutubeDlHelper.FindAndRunYoutubeDl(link);

            if (!result.Ok)
            {
                return(result.Message);
            }

            var    response = result.Value;
            string title    = response.Item1;
            string url      = response.Item2.FirstOrDefault();

            if (response.Item2.Count == 0 || string.IsNullOrEmpty(title) || string.IsNullOrEmpty(url))
            {
                return("No youtube-dl response");
            }

            Log.Write(Log.Level.Debug, "SC Saved!");

            return(new PlayResource(url, new AudioResource(link, title, FactoryFor)));
        }