Exemplo n.º 1
0
        public async Task <Book> GetBook(string catalogId)
        {
            var urlId    = CatalogResolver.Resolve(catalogId).UrlId;
            var uri      = new Uri($"{MEK_ENDPOINT_URL}/{urlId}/index.xml");
            var response = await GetAsync(uri);

            var html = MekConvert.ToUtf8(await response.Content.ReadAsByteArrayAsync());

            return(MekFactory.CreateBookFromIndex(html));
        }
Exemplo n.º 2
0
        public async Task <AudioBook> GetAudioBook(string catalogId)
        {
            var urlId    = CatalogResolver.Resolve(catalogId).UrlId;
            var url      = $"{MEK_ENDPOINT_URL}/{urlId}/mp3/";
            var response = await GetAsync(new Uri(url));

            var html      = MekConvert.ToUtf8(await response.Content.ReadAsByteArrayAsync());
            var audioBook = await GetBook(catalogId);

            var trackBook = MekFactory.CreateAudioBookFromMP3Page(url, html);

            trackBook.Copy(audioBook);

            return(trackBook);
        }