mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-15 15:57:54 +02:00
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)
This commit is contained in:
@ -154,15 +154,16 @@ public class Webtoons : MangaConnector
|
|||||||
return Array.Empty<Chapter>();
|
return Array.Empty<Chapter>();
|
||||||
|
|
||||||
// Get number of pages
|
// 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<Chapter> chapters = new List<Chapter>();
|
List<Chapter> chapters = new List<Chapter>();
|
||||||
|
|
||||||
for(int page = 1; page <= pages; page++) {
|
for(int page = 1; page <= pages; page++) {
|
||||||
string pageRequestUrl = $"{requestUrl}&page={page}";
|
string pageRequestUrl = $"{requestUrl}&page={page}";
|
||||||
|
|
||||||
chapters.AddRange(ParseChaptersFromHtml(manga, pageRequestUrl));
|
chapters.AddRange(ParseChaptersFromHtml(manga, pageRequestUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
Log($"Got {chapters.Count} chapters. {manga}");
|
Log($"Got {chapters.Count} chapters. {manga}");
|
||||||
return chapters.Order().ToArray();
|
return chapters.Order().ToArray();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user