mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 15:50:13 +01:00
Fix MangaSee publicationId
This commit is contained in:
parent
0f17615b10
commit
85bf3ec7e8
@ -91,7 +91,8 @@ public class Mangasee : MangaConnector
|
|||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Regex publicationIdRex = new(@"https:\/\/mangasee123.com\/manga\/(.*)(\/.*)*");
|
||||||
|
string publicationId = publicationIdRex.Match(url).Groups[1].Value;
|
||||||
IPage page = _browser!.NewPageAsync().Result;
|
IPage page = _browser!.NewPageAsync().Result;
|
||||||
IResponse response = page.GoToAsync(url, WaitUntilNavigation.DOMContentLoaded).Result;
|
IResponse response = page.GoToAsync(url, WaitUntilNavigation.DOMContentLoaded).Result;
|
||||||
if (response.Ok)
|
if (response.Ok)
|
||||||
@ -99,7 +100,7 @@ public class Mangasee : MangaConnector
|
|||||||
HtmlDocument document = new();
|
HtmlDocument document = new();
|
||||||
document.LoadHtml(page.GetContentAsync().Result);
|
document.LoadHtml(page.GetContentAsync().Result);
|
||||||
page.CloseAsync();
|
page.CloseAsync();
|
||||||
return ParseSinglePublicationFromHtml(document);
|
return ParseSinglePublicationFromHtml(document, publicationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
page.CloseAsync();
|
page.CloseAsync();
|
||||||
@ -137,7 +138,7 @@ public class Mangasee : MangaConnector
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Manga ParseSinglePublicationFromHtml(HtmlDocument document)
|
private Manga ParseSinglePublicationFromHtml(HtmlDocument document, string publicationId)
|
||||||
{
|
{
|
||||||
string originalLanguage = "", status = "";
|
string originalLanguage = "", status = "";
|
||||||
Dictionary<string, string> altTitles = new(), links = new();
|
Dictionary<string, string> altTitles = new(), links = new();
|
||||||
@ -149,7 +150,6 @@ public class Mangasee : MangaConnector
|
|||||||
|
|
||||||
HtmlNode titleNode = document.DocumentNode.SelectSingleNode("//div[@class='BoxBody']//div[@class='row']//h1");
|
HtmlNode titleNode = document.DocumentNode.SelectSingleNode("//div[@class='BoxBody']//div[@class='row']//h1");
|
||||||
string sortName = titleNode.InnerText;
|
string sortName = titleNode.InnerText;
|
||||||
string publicationId = sortName;
|
|
||||||
|
|
||||||
HtmlNode[] authorsNodes = document.DocumentNode.SelectNodes("//div[@class='BoxBody']//div[@class='row']//span[text()='Author(s):']/..").Descendants("a").ToArray();
|
HtmlNode[] authorsNodes = document.DocumentNode.SelectNodes("//div[@class='BoxBody']//div[@class='row']//span[text()='Author(s):']/..").Descendants("a").ToArray();
|
||||||
List<string> authors = new();
|
List<string> authors = new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user