From 4ad314952352a55bc73fb60c70f9d10582d5f2a6 Mon Sep 17 00:00:00 2001 From: Makhuta Date: Tue, 11 Feb 2025 20:16:30 +0100 Subject: [PATCH] Fix - fixed when parsing chapters the pages was incorrectly parsed resulting into adding the chapters from the last page multiple times (was still downloading OK but it would try to download the chapters from last page multiple times) --- Tranga/MangaConnectors/Webtoons.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tranga/MangaConnectors/Webtoons.cs b/Tranga/MangaConnectors/Webtoons.cs index 238bf51..9e78290 100644 --- a/Tranga/MangaConnectors/Webtoons.cs +++ b/Tranga/MangaConnectors/Webtoons.cs @@ -154,15 +154,16 @@ public class Webtoons : MangaConnector return Array.Empty(); // Get number of pages - int pages = requestResult.htmlDocument.DocumentNode.SelectSingleNode("//div[contains(@class, 'paginate')]").ChildNodes.ToArray().Length; + int pages = requestResult.htmlDocument.DocumentNode + .SelectNodes("//div[contains(@class, 'paginate')]/a") + .ToList() + .Count; List chapters = new List(); for(int page = 1; page <= pages; page++) { string pageRequestUrl = $"{requestUrl}&page={page}"; - chapters.AddRange(ParseChaptersFromHtml(manga, pageRequestUrl)); } - Log($"Got {chapters.Count} chapters. {manga}"); return chapters.Order().ToArray(); }