Fixes search (#7771)

This commit is contained in:
Narin 2021-06-20 15:43:46 -07:00 committed by GitHub
parent 9afcf9e50c
commit 981ad1b8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'WNACG'
pkgNameSuffix = 'zh.wnacg'
extClass = '.wnacg'
extVersionCode = 4
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -35,7 +35,7 @@ class wnacg : ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int) = throw Exception("Not used")
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
return GET("$baseUrl/albums-index-page-$page-sname-$query.html", headers)
return GET("$baseUrl/search/index.php?q=$query&p=$page", headers)
}
override fun mangaDetailsRequest(manga: SManga) = GET(baseUrl + manga.url, headers)
@ -55,7 +55,7 @@ class wnacg : ParsedHttpSource() {
private fun mangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.setUrlWithoutDomain(element.select("a").first().attr("href"))
manga.title = element.select("a").attr("title").trim()
manga.title = element.select("a").attr("title").trim().replace(Regex("<[^<>]*>"), "")
manga.thumbnail_url = "https://" + element.select("img").attr("src").replace("//", "")
// maybe the local cache cause the old source (url) can not be update. but the image can be update on detailpage.
// ps. new machine can be load img normal.