static async Task Main(string[] args)
        {
            var downloader         = new HtmlTextDownloader();
            var audioElementRipper = new AudioElementRipper();
            var titleRipper        = new AudioTitleRipper();
            var sourceRipper       = new AudioSourceRipper();
            var audioLibraryEntriesToJsonConverter = new AudioLibraryEntriesToJsonConverter();

            var audioLibraryEntriesRetriever = new AudioLibraryEntriesRetriever(downloader, audioElementRipper, titleRipper, sourceRipper);

            try
            {
                var request = ProcessArgs(args);

                var audioLibraryEntries = await audioLibraryEntriesRetriever.RetrieveAsync(skillsKitLinks);

                var jsonString = audioLibraryEntriesToJsonConverter.ConvertToJsonString(audioLibraryEntries);

                var path = Path.GetDirectoryName(request.WritePath.AbsolutePath + @"\");

                Console.WriteLine($"{request.WritePath.AbsolutePath}");

                await File.WriteAllTextAsync(path, jsonString);
            }
            catch (System.UriFormatException)
            {
                Console.Write("There was a problem processing your request.");
            }
        }
Exemplo n.º 2
0
 public AudioLibraryEntriesRetriever(HtmlTextDownloader downloader, AudioElementRipper audioElementRipper, AudioTitleRipper audioTitleRipper, AudioSourceRipper audioSourceRipper)
 {
     this.downloader         = downloader;
     this.audioElementRipper = audioElementRipper;
     this.audioTitleRipper   = audioTitleRipper;
     this.audioSourceRipper  = audioSourceRipper;
 }
Exemplo n.º 3
0
        private static AudioLibraryEntry Create(AudioTagCategory category, string tag, AudioTitleRipper titleRipper, AudioSourceRipper sourceRipper)
        {
            var title  = titleRipper.Rip(tag);
            var source = sourceRipper.Rip(tag);

            return(new AudioLibraryEntry(category.Name, category.Address, title, new Uri(source)));
        }