mirror of
https://github.com/C9Glax/tranga.git
synced 2025-01-12 11:27:32 +01:00
Mangasee more logging
This commit is contained in:
parent
2333cd9095
commit
715244ff1b
@ -99,18 +99,23 @@ public class Mangasee : Connector
|
|||||||
queryFiltered = queryFiltered.Where(item => item.Value >= publicationTitle.Split(' ').Length - 1)
|
queryFiltered = queryFiltered.Where(item => item.Value >= publicationTitle.Split(' ').Length - 1)
|
||||||
.ToDictionary(item => item.Key, item => item.Value);
|
.ToDictionary(item => item.Key, item => item.Value);
|
||||||
|
|
||||||
|
logger?.WriteLine(this.GetType().ToString(), $"Got {queryFiltered.Count} Publications (title={publicationTitle})");
|
||||||
|
|
||||||
HashSet<Publication> ret = new();
|
HashSet<Publication> ret = new();
|
||||||
List<SearchResultItem> orderedFiltered =
|
List<SearchResultItem> orderedFiltered =
|
||||||
queryFiltered.OrderBy(item => item.Value).ToDictionary(item => item.Key, item => item.Value).Keys.ToList();
|
queryFiltered.OrderBy(item => item.Value).ToDictionary(item => item.Key, item => item.Value).Keys.ToList();
|
||||||
|
|
||||||
|
uint index = 1;
|
||||||
foreach (SearchResultItem orderedItem in orderedFiltered)
|
foreach (SearchResultItem orderedItem in orderedFiltered)
|
||||||
{
|
{
|
||||||
DownloadClient.RequestResult requestResult =
|
DownloadClient.RequestResult requestResult =
|
||||||
downloadClient.MakeRequest($"https://mangasee123.com/manga/{orderedItem.i}", (byte)1);
|
downloadClient.MakeRequest($"https://mangasee123.com/manga/{orderedItem.i}", (byte)1);
|
||||||
if ((int)requestResult.statusCode < 200 || (int)requestResult.statusCode >= 300)
|
if ((int)requestResult.statusCode >= 200 || (int)requestResult.statusCode < 300)
|
||||||
return Array.Empty<Publication>();
|
{
|
||||||
|
logger?.WriteLine(this.GetType().ToString(), $"Retrieving Publication info: {orderedItem.s} {index++}/{orderedFiltered.Count}");
|
||||||
ret.Add(ParseSinglePublicationFromHtml(requestResult.result, orderedItem.s, orderedItem.i, orderedItem.a));
|
ret.Add(ParseSinglePublicationFromHtml(requestResult.result, orderedItem.s, orderedItem.i, orderedItem.a));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ret.ToArray();
|
return ret.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,9 +123,8 @@ public class Mangasee : Connector
|
|||||||
private Publication ParseSinglePublicationFromHtml(Stream html, string sortName, string publicationId, string[] a)
|
private Publication ParseSinglePublicationFromHtml(Stream html, string sortName, string publicationId, string[] a)
|
||||||
{
|
{
|
||||||
StreamReader reader = new (html);
|
StreamReader reader = new (html);
|
||||||
string htmlString = reader.ReadToEnd();
|
|
||||||
HtmlDocument document = new ();
|
HtmlDocument document = new ();
|
||||||
document.LoadHtml(htmlString);
|
document.LoadHtml(reader.ReadToEnd());
|
||||||
|
|
||||||
string originalLanguage = "", status = "";
|
string originalLanguage = "", status = "";
|
||||||
Dictionary<string, string> altTitles = new(), links = new();
|
Dictionary<string, string> altTitles = new(), links = new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user