From c03e927565aa80a687b558b81314508bfdd50d59 Mon Sep 17 00:00:00 2001 From: Glax Date: Wed, 7 Feb 2024 19:23:55 +0100 Subject: [PATCH] Fix Mangaworld #103 Plurals --- Tranga/MangaConnectors/Mangaworld.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tranga/MangaConnectors/Mangaworld.cs b/Tranga/MangaConnectors/Mangaworld.cs index 7f4dc93..f6b63bb 100644 --- a/Tranga/MangaConnectors/Mangaworld.cs +++ b/Tranga/MangaConnectors/Mangaworld.cs @@ -69,7 +69,7 @@ public class Mangaworld: MangaConnector if (requestResult.htmlDocument is null) return null; - Regex idRex = new (@"https:\/\/www\.mangaworld\.[a-z]{0,63}\/manga\/([0-9]+\/[0-9A-z\-]+)"); + Regex idRex = new (@"https:\/\/www\.mangaworld\.[a-z]{0,63}\/manga\/([0-9]+\/[0-9A-z\-]+)\/.*"); string id = idRex.Match(url).Groups[1].Value; return ParseSinglePublicationFromHtml(requestResult.htmlDocument, id); } @@ -87,19 +87,19 @@ public class Mangaworld: MangaConnector HtmlNode metadata = infoNode.Descendants().First(d => d.HasClass("meta-data")); - HtmlNode altTitlesNode = metadata.SelectSingleNode("//span[text()='Titoli alternativi: ']/..").ChildNodes[1]; + HtmlNode altTitlesNode = metadata.SelectSingleNode("//span[text()='Titoli alternativi: ' or text()='Titolo alternativo: ']/..").ChildNodes[1]; string[] alts = altTitlesNode.InnerText.Split(", "); for(int i = 0; i < alts.Length; i++) altTitles.Add(i.ToString(), alts[i]); HtmlNode genresNode = - metadata.SelectSingleNode("//span[text()='Generi: ']/.."); + metadata.SelectSingleNode("//span[text()='Generi: ' or text()='Genero: ']/.."); HashSet tags = genresNode.SelectNodes("a").Select(node => node.InnerText).ToHashSet(); HtmlNode authorsNode = - metadata.SelectSingleNode("//span[text()='Autore: ']/.."); - string[] authors = new[] { authorsNode.SelectNodes("a").First().InnerText }; + metadata.SelectSingleNode("//span[text()='Autore: ' or text()='Autori: ']/.."); + string[] authors = authorsNode.SelectNodes("a").Select(node => node.InnerText).ToArray(); string status = metadata.SelectSingleNode("//span[text()='Stato: ']/..").SelectNodes("a").First().InnerText; // ReSharper disable 5 times StringLiteralTypo