Merge pull request 'Fixes for MangaKatana' (!53) from cuttingedge into master
Reviewed-on: #53
This commit is contained in:
commit
a4f67c9ab4
@ -82,12 +82,11 @@ public class Server
|
|||||||
response.OutputStream.Write(content is not null
|
response.OutputStream.Write(content is not null
|
||||||
? Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(content))
|
? Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(content))
|
||||||
: Array.Empty<byte>());
|
: Array.Empty<byte>());
|
||||||
|
response.OutputStream.Close();
|
||||||
}
|
}
|
||||||
catch (HttpListenerException)
|
catch (HttpListenerException)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
response.OutputStream.Close();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,7 +22,7 @@ public class MangaKatana : Connector
|
|||||||
protected override Publication[] GetPublicationsInternal(string publicationTitle = "")
|
protected override Publication[] GetPublicationsInternal(string publicationTitle = "")
|
||||||
{
|
{
|
||||||
commonObjects.logger?.WriteLine(this.GetType().ToString(), $"Getting Publications (title={publicationTitle})");
|
commonObjects.logger?.WriteLine(this.GetType().ToString(), $"Getting Publications (title={publicationTitle})");
|
||||||
string sanitizedTitle = string.Concat(Regex.Matches(publicationTitle, "[A-z]* *")).ToLower().Replace(' ', '_');
|
string sanitizedTitle = string.Join('_', Regex.Matches(publicationTitle, "[A-z]*").Where(m => m.Value.Length > 0)).ToLower();
|
||||||
string requestUrl = $"https://mangakatana.com/?search={sanitizedTitle}&search_by=book_name";
|
string requestUrl = $"https://mangakatana.com/?search={sanitizedTitle}&search_by=book_name";
|
||||||
DownloadClient.RequestResult requestResult =
|
DownloadClient.RequestResult requestResult =
|
||||||
downloadClient.MakeRequest(requestUrl, 1);
|
downloadClient.MakeRequest(requestUrl, 1);
|
||||||
@ -48,6 +48,8 @@ public class MangaKatana : Connector
|
|||||||
HtmlDocument document = new();
|
HtmlDocument document = new();
|
||||||
document.LoadHtml(htmlString);
|
document.LoadHtml(htmlString);
|
||||||
IEnumerable<HtmlNode> searchResults = document.DocumentNode.SelectNodes("//*[@id='book_list']/div");
|
IEnumerable<HtmlNode> searchResults = document.DocumentNode.SelectNodes("//*[@id='book_list']/div");
|
||||||
|
if (searchResults is null || !searchResults.Any())
|
||||||
|
return Array.Empty<Publication>();
|
||||||
List<string> urls = new();
|
List<string> urls = new();
|
||||||
foreach (HtmlNode mangaResult in searchResults)
|
foreach (HtmlNode mangaResult in searchResults)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user