Пример #1
0
        public static void UpdatePages(MangaReader.Core.Manga.Chapter chapter)
        {
            chapter.Container.Clear();
            var pages = new List <MangaPage>();

            try
            {
                var document = new HtmlDocument();
                document.LoadHtml(Page.GetPage(chapter.Uri, GetClient()).Content);

                var i    = 0;
                var imgs = Regex.Match(document.DocumentNode.OuterHtml, @"""(fullimg.*)", RegexOptions.IgnoreCase).Groups[1].Value.Remove(0, 9);
                foreach (Match match in Regex.Matches(imgs, @"""(.*?)"","))
                {
                    pages.Add(new MangaPage(chapter.Uri, new Uri(match.Groups[1].Value), i++));
                }
            }
            catch (Exception ex) { Log.Exception(ex); }

            chapter.Container.AddRange(pages);
        }
Пример #2
0
        public override async Task UpdatePages(MangaReader.Core.Manga.Chapter chapter)
        {
            chapter.Container.Clear();
            var pages = new List <MangaPage>();

            try
            {
                var document = new HtmlDocument();
                var client   = await MangachanPlugin.Instance.GetCookieClient(true).ConfigureAwait(false);

                document.LoadHtml((await client.GetPage(chapter.Uri).ConfigureAwait(false)).Content);

                var i    = 0;
                var imgs = Regex.Match(document.DocumentNode.OuterHtml, @"""(fullimg.*)", RegexOptions.IgnoreCase).Groups[1].Value.Remove(0, 9);
                foreach (Match match in Regex.Matches(imgs, @"""(.*?)"","))
                {
                    pages.Add(new MangaPage(chapter.Uri, new Uri(match.Groups[1].Value), i++, chapter));
                }
            }
            catch (Exception ex) { Log.Exception(ex); }

            chapter.Container.AddRange(pages);
        }
Пример #3
0
        public static void UpdatePages(MangaReader.Core.Manga.Chapter chapter)
        {
            chapter.Container.Clear();
            var pages = new List <MangaPage>();

            try
            {
                var document = new HtmlDocument();
                var page     = GetPageWithRedirect(chapter.Uri);
                document.LoadHtml(page.Item1.Content);

                var imgs       = Regex.Match(document.DocumentNode.OuterHtml, @"""(fullimg.*)", RegexOptions.IgnoreCase).Groups[1].Value.Remove(0, 9);
                var jsonParsed = JToken.Parse(imgs).Children().ToList();
                for (var i = 0; i < jsonParsed.Count; i++)
                {
                    var uriString = jsonParsed[i].ToString();
                    pages.Add(new MangaPage(chapter.Uri, new Uri(uriString), i + 1));
                }
            }
            catch (Exception ex) { Log.Exception(ex); }

            chapter.Container.AddRange(pages);
        }