mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-22 07:10:13 +01:00
Merge pull request #340 from Makhuta/cuttingedge
Some checks failed
Docker Image CI / build (push) Has been cancelled
Some checks failed
Docker Image CI / build (push) Has been cancelled
Fix the Webtoons connector getting few chapters multiple times
This commit is contained in:
commit
9cef068785
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user