HentaiVN: fix covers and no results (#5760)

This commit is contained in:
scb261 2021-02-11 14:50:18 +02:00 committed by GitHub
parent 565b2a4af2
commit 3a02da8d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'HentaiVN' extName = 'HentaiVN'
pkgNameSuffix = 'vi.hentaivn' pkgNameSuffix = 'vi.hentaivn'
extClass = '.HentaiVN' extClass = '.HentaiVN'
extVersionCode = 5 extVersionCode = 6
libVersion = '1.2' libVersion = '1.2'
containsNsfw = true containsNsfw = true
} }

View File

@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.CookieJar
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -25,7 +26,9 @@ class HentaiVN : ParsedHttpSource() {
override val lang = "vi" override val lang = "vi"
override val name = "HentaiVN" override val name = "HentaiVN"
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient override val client: OkHttpClient = network.client.newBuilder()
.cookieJar(CookieJar.NO_COOKIES)
.build()
override fun headersBuilder(): Headers.Builder = super.headersBuilder().add("Referer", baseUrl) override fun headersBuilder(): Headers.Builder = super.headersBuilder().add("Referer", baseUrl)
private val dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH) private val dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH)
@ -58,7 +61,7 @@ class HentaiVN : ParsedHttpSource() {
manga.setUrlWithoutDomain(it.attr("href")) manga.setUrlWithoutDomain(it.attr("href"))
manga.title = it.text().trim() manga.title = it.text().trim()
} }
manga.thumbnail_url = element.select("img.img-list").attr("abs:src") manga.thumbnail_url = element.select(".box-cover a img").attr("data-src")
return manga return manga
} }
@ -76,7 +79,7 @@ class HentaiVN : ParsedHttpSource() {
manga.author = infoElement.select("p:contains(Tác giả:) a").text() manga.author = infoElement.select("p:contains(Tác giả:) a").text()
manga.description = infoElement.select(":root > p:contains(Nội dung:) + p").text() manga.description = infoElement.select(":root > p:contains(Nội dung:) + p").text()
manga.genre = infoElement.select("p:contains(Thể loại:) a").joinToString { it.text() } manga.genre = infoElement.select("p:contains(Thể loại:) a").joinToString { it.text() }
manga.thumbnail_url = document.select(".main > .page-right > .right-info > .page-ava > img").attr("abs:src") manga.thumbnail_url = document.select(".main > .page-right > .right-info > .page-ava > img").attr("src")
manga.status = parseStatus(infoElement.select("p:contains(Tình Trạng:) a").firstOrNull()?.text()) manga.status = parseStatus(infoElement.select("p:contains(Tình Trạng:) a").firstOrNull()?.text())
return manga return manga
} }