parent
67dc44c763
commit
7ee2bfc61e
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'NineManga'
|
extName = 'NineManga'
|
||||||
pkgNameSuffix = "all.ninemanga"
|
pkgNameSuffix = "all.ninemanga"
|
||||||
extClass = '.NineMangaFactory'
|
extClass = '.NineMangaFactory'
|
||||||
extVersionCode = 18
|
extVersionCode = 19
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
|
@ -25,6 +26,19 @@ open class NineManga(
|
||||||
|
|
||||||
override val supportsLatest: Boolean = true
|
override val supportsLatest: Boolean = true
|
||||||
|
|
||||||
|
override val client: OkHttpClient = network.client.newBuilder()
|
||||||
|
.addInterceptor { chain ->
|
||||||
|
val request = chain.request()
|
||||||
|
val url = request.url.toString()
|
||||||
|
if (url.contains("""img\d.\.niadd.com""".toRegex())) {
|
||||||
|
val newRequest = request.newBuilder()
|
||||||
|
.addHeader("Referer", "$baseUrl/")
|
||||||
|
.build()
|
||||||
|
return@addInterceptor chain.proceed(newRequest)
|
||||||
|
}
|
||||||
|
chain.proceed(request)
|
||||||
|
}.build()
|
||||||
|
|
||||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||||
.add("Accept-Language", "es-ES,es;q=0.9,en;q=0.8,gl;q=0.7")
|
.add("Accept-Language", "es-ES,es;q=0.9,en;q=0.8,gl;q=0.7")
|
||||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) Gecko/20100101 Firefox/75")
|
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) Gecko/20100101 Firefox/75")
|
||||||
|
|
Loading…
Reference in New Issue