|
|
|
@ -21,6 +21,7 @@ public class Manganato : Connector
|
|
|
|
|
|
|
|
|
|
public override Publication[] GetPublications(string publicationTitle = "")
|
|
|
|
|
{
|
|
|
|
|
logger?.WriteLine(this.GetType().ToString(), $"Getting Publications (title={publicationTitle})");
|
|
|
|
|
string sanitizedTitle = publicationTitle.ToLower().Replace(' ', '_');
|
|
|
|
|
logger?.WriteLine(this.GetType().ToString(), $"Getting Publications (title={sanitizedTitle})");
|
|
|
|
|
string requestUrl = $"https://manganato.com/search/story/{sanitizedTitle}";
|
|
|
|
@ -71,7 +72,7 @@ public class Manganato : Connector
|
|
|
|
|
Dictionary<string, string>? links = null;
|
|
|
|
|
HashSet<string> tags = new();
|
|
|
|
|
string? author = null, originalLanguage = null;
|
|
|
|
|
int? year = null;
|
|
|
|
|
int? year = DateTime.Now.Year;
|
|
|
|
|
|
|
|
|
|
HtmlNode infoNode = document.DocumentNode.Descendants("div").First(d => d.HasClass("story-info-right"));
|
|
|
|
|
|
|
|
|
@ -112,8 +113,13 @@ public class Manganato : Connector
|
|
|
|
|
string coverFileNameInCache = SaveCoverImageToCache(posterUrl, 1);
|
|
|
|
|
|
|
|
|
|
string description = document.DocumentNode.Descendants("div").First(d => d.HasClass("panel-story-info-description"))
|
|
|
|
|
.InnerText;
|
|
|
|
|
.InnerText.Replace("Description :", "");
|
|
|
|
|
while (description.StartsWith('\n'))
|
|
|
|
|
description = description.Substring(1);
|
|
|
|
|
|
|
|
|
|
string yearString = document.DocumentNode.Descendants("li").Last(li => li.HasClass("a-h")).Descendants("span")
|
|
|
|
|
.First(s => s.HasClass("chapter-time")).InnerText;
|
|
|
|
|
year = Convert.ToInt32(yearString.Split(',')[^1]) + 2000;
|
|
|
|
|
|
|
|
|
|
return new Publication(sortName, author, description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links,
|
|
|
|
|
year, originalLanguage, status, publicationId);
|
|
|
|
@ -121,7 +127,8 @@ public class Manganato : Connector
|
|
|
|
|
|
|
|
|
|
public override Chapter[] GetChapters(Publication publication, string language = "")
|
|
|
|
|
{
|
|
|
|
|
string requestUrl = $"https://manganato.com/{publication.publicationId}";
|
|
|
|
|
logger?.WriteLine(this.GetType().ToString(), $"Getting Chapters for {publication.sortName} {publication.internalId} (language={language})");
|
|
|
|
|
string requestUrl = $"https://chapmanganato.com/{publication.publicationId}";
|
|
|
|
|
DownloadClient.RequestResult requestResult =
|
|
|
|
|
downloadClient.MakeRequest(requestUrl, (byte)1);
|
|
|
|
|
if (requestResult.statusCode != HttpStatusCode.OK)
|
|
|
|
@ -157,6 +164,7 @@ public class Manganato : Connector
|
|
|
|
|
|
|
|
|
|
public override void DownloadChapter(Publication publication, Chapter chapter)
|
|
|
|
|
{
|
|
|
|
|
logger?.WriteLine(this.GetType().ToString(), $"Downloading Chapter-Info {publication.sortName} {publication.internalId} {chapter.volumeNumber}-{chapter.chapterNumber}");
|
|
|
|
|
string requestUrl = chapter.url;
|
|
|
|
|
DownloadClient.RequestResult requestResult =
|
|
|
|
|
downloadClient.MakeRequest(requestUrl, (byte)1);
|
|
|
|
|