mirror of
https://github.com/C9Glax/tranga.git
synced 2025-04-19 06:43:18 +02:00
Merge pull request #376 from C9Glax/cuttingedge
Some checks failed
Docker Image CI / build (push) Has been cancelled
Some checks failed
Docker Image CI / build (push) Has been cancelled
Weebcentral fixxes
This commit is contained in:
commit
6faf8bc733
@ -56,7 +56,7 @@ public class Webtoons : MangaConnector
|
|||||||
Log($"Failed to retrieve site");
|
Log($"Failed to retrieve site");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Regex regex = new Regex(@".*webtoons\.com/en/(?<category>[^/]+)/(?<title>[^/]+)/list\?title_no=(?<id>\d+).*");
|
Regex regex = new Regex(@".*webtoons\.com\/en\/(?<category>[^\/]+)\/(?<title>[^\/]+)\/list\?title_no=(?<id>\d+).*");
|
||||||
Match match = regex.Match(url);
|
Match match = regex.Match(url);
|
||||||
|
|
||||||
if(match.Success) {
|
if(match.Success) {
|
||||||
@ -110,7 +110,7 @@ public class Webtoons : MangaConnector
|
|||||||
|
|
||||||
HtmlNode posterNode = document.DocumentNode.SelectSingleNode("//div[contains(@class, 'detail_body') and contains(@class, 'banner')]");
|
HtmlNode posterNode = document.DocumentNode.SelectSingleNode("//div[contains(@class, 'detail_body') and contains(@class, 'banner')]");
|
||||||
|
|
||||||
Regex regex = new Regex(@"url\((?<url>.*?)\)");
|
Regex regex = new Regex(@"url\('(?<url>.*?)'\)");
|
||||||
Match match = regex.Match(posterNode.GetAttributeValue("style", ""));
|
Match match = regex.Match(posterNode.GetAttributeValue("style", ""));
|
||||||
|
|
||||||
string posterUrl = match.Groups["url"].Value;
|
string posterUrl = match.Groups["url"].Value;
|
||||||
|
@ -44,7 +44,7 @@ public class Weebcentral : MangaConnector
|
|||||||
if (document.DocumentNode.SelectNodes("//article") == null)
|
if (document.DocumentNode.SelectNodes("//article") == null)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
List<string> urls = document.DocumentNode.SelectNodes("/html/body/article/a[@class='link link-hover']")
|
List<string> urls = document.DocumentNode.SelectNodes("/html/body/article/a[@class='link link-hover tooltip tooltip-bottom']")
|
||||||
.Select(elem => elem.GetAttributeValue("href", "")).ToList();
|
.Select(elem => elem.GetAttributeValue("href", "")).ToList();
|
||||||
|
|
||||||
HashSet<Manga> ret = new();
|
HashSet<Manga> ret = new();
|
||||||
@ -210,6 +210,6 @@ public class Weebcentral : MangaConnector
|
|||||||
document.DocumentNode.SelectNodes($"//section[@hx-get='{chapter.url}/images']/img")?.ToArray() ?? [];
|
document.DocumentNode.SelectNodes($"//section[@hx-get='{chapter.url}/images']/img")?.ToArray() ?? [];
|
||||||
string[] urls = imageNodes.Select(imgNode => imgNode.GetAttributeValue("src", "")).ToArray();
|
string[] urls = imageNodes.Select(imgNode => imgNode.GetAttributeValue("src", "")).ToArray();
|
||||||
|
|
||||||
return DownloadChapterImages(urls, chapter, RequestType.MangaImage, progressToken: progressToken);
|
return DownloadChapterImages(urls, chapter, RequestType.MangaImage, progressToken: progressToken, referrer: "https://weebcentral.com/");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user