Compare commits
No commits in common. "38df54baffac5056619a9f4a2b9b144a3c7fd227" and "3381909afdc053d3a41147b6c68c1cb4b9330009" have entirely different histories.
38df54baff
...
3381909afd
@ -139,16 +139,15 @@ public class Bato : MangaConnector
|
|||||||
HtmlNode chapterList =
|
HtmlNode chapterList =
|
||||||
result.htmlDocument.DocumentNode.SelectSingleNode("/html/body/div/main/div[3]/astro-island/div/div[2]/div/div/astro-slot");
|
result.htmlDocument.DocumentNode.SelectSingleNode("/html/body/div/main/div[3]/astro-island/div/div[2]/div/div/astro-slot");
|
||||||
|
|
||||||
Regex numberRex = new(@"\/title\/.+\/[0-9]+(-vol_([0-9]+))?-ch_([0-9\.]+)");
|
Regex chapterNumberRex = new(@"\/title\/.+\/[0-9]+-ch_([0-9\.]+)");
|
||||||
|
|
||||||
foreach (HtmlNode chapterInfo in chapterList.SelectNodes("div"))
|
foreach (HtmlNode chapterInfo in chapterList.SelectNodes("div"))
|
||||||
{
|
{
|
||||||
HtmlNode infoNode = chapterInfo.FirstChild.FirstChild;
|
HtmlNode infoNode = chapterInfo.FirstChild.FirstChild;
|
||||||
string chapterUrl = infoNode.GetAttributeValue("href", "");
|
string chapterUrl = infoNode.GetAttributeValue("href", "");
|
||||||
|
|
||||||
Match match = numberRex.Match(chapterUrl);
|
string? volumeNumber = null;
|
||||||
string? volumeNumber = match.Groups[2].Success ? match.Groups[2].Value : null;
|
string chapterNumber = chapterNumberRex.Match(chapterUrl).Groups[1].Value;
|
||||||
string chapterNumber = match.Groups[3].Value;
|
|
||||||
string chapterName = chapterNumber;
|
string chapterName = chapterNumber;
|
||||||
string url = $"https://bato.to{chapterUrl}?load=2";
|
string url = $"https://bato.to{chapterUrl}?load=2";
|
||||||
ret.Add(new Chapter(manga, chapterName, volumeNumber, chapterNumber, url));
|
ret.Add(new Chapter(manga, chapterName, volumeNumber, chapterNumber, url));
|
||||||
@ -206,8 +205,7 @@ public class Bato : MangaConnector
|
|||||||
|
|
||||||
string weirdString = images.OuterHtml;
|
string weirdString = images.OuterHtml;
|
||||||
string weirdString2 = Regex.Match(weirdString, @"props=\""(.*)}\""").Groups[1].Value;
|
string weirdString2 = Regex.Match(weirdString, @"props=\""(.*)}\""").Groups[1].Value;
|
||||||
string[] urls = Regex.Matches(weirdString2, @"(https:\/\/[A-z\-0-9\.\?\&\;\=\/]+)\\")
|
string[] urls = Regex.Matches(weirdString2, @"https:\/\/[A-z\-0-9\.\?\&\;\=\/]*").Select(m => m.Value.Replace("\\"]", "").Replace("amp;", "")).ToArray();
|
||||||
.Select(match => match.Groups[1].Value.Replace("&", "&")).ToArray();
|
|
||||||
|
|
||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
@ -37,17 +37,10 @@ internal class HttpDownloadClient : DownloadClient
|
|||||||
{
|
{
|
||||||
response = Client.Send(requestMessage);
|
response = Client.Send(requestMessage);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (TaskCanceledException e)
|
||||||
{
|
{
|
||||||
switch (e)
|
Log($"Request timed out.\n\r{e}");
|
||||||
{
|
return new RequestResult(HttpStatusCode.RequestTimeout, null, Stream.Null);
|
||||||
case TaskCanceledException:
|
|
||||||
Log($"Request timed out.\n\r{e}");
|
|
||||||
return new RequestResult(HttpStatusCode.RequestTimeout, null, Stream.Null);
|
|
||||||
case HttpRequestException:
|
|
||||||
Log($"Request failed\n\r{e}");
|
|
||||||
return new RequestResult(HttpStatusCode.BadRequest, null, Stream.Null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user