HentaiVN - Headers (#2474)

HentaiVN - Thumbnail Fix
This commit is contained in:
happywillow0 2020-03-22 09:22:16 -04:00 committed by GitHub
parent dae633bc1f
commit 53a36797f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: HentaiVN' appName = 'Tachiyomi: HentaiVN'
pkgNameSuffix = 'vi.hentaivn' pkgNameSuffix = 'vi.hentaivn'
extClass = '.HentaiVN' extClass = '.HentaiVN'
extVersionCode = 4 extVersionCode = 5
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.vi.hentaivn
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -20,6 +21,7 @@ class HentaiVN : ParsedHttpSource() {
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.cloudflareClient
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)
@ -90,11 +92,6 @@ class HentaiVN : ParsedHttpSource() {
return pages return pages
} }
override fun imageRequest(page: Page): Request {
val imgHeaders = headersBuilder().add("Referer", page.url).build()
return GET(page.imageUrl!!, imgHeaders)
}
override fun popularMangaFromElement(element: Element) = latestUpdatesFromElement(element) override fun popularMangaFromElement(element: Element) = latestUpdatesFromElement(element)
override fun popularMangaNextPageSelector() = latestUpdatesNextPageSelector() override fun popularMangaNextPageSelector() = latestUpdatesNextPageSelector()