Handle new default user agent where SY uses it
(cherry picked from commit f3ffd3b930ba5d064bfac9138d15614f18d72c04)
This commit is contained in:
parent
58ef239959
commit
8df8622dfa
@ -121,16 +121,16 @@ class MangaDex(delegate: HttpSource, val context: Context) :
|
|||||||
MangaPlusHandler(network.client)
|
MangaPlusHandler(network.client)
|
||||||
}
|
}
|
||||||
private val comikeyHandler by lazy {
|
private val comikeyHandler by lazy {
|
||||||
ComikeyHandler(network.cloudflareClient)
|
ComikeyHandler(network.cloudflareClient, network.defaultUserAgent)
|
||||||
}
|
}
|
||||||
private val bilibiliHandler by lazy {
|
private val bilibiliHandler by lazy {
|
||||||
BilibiliHandler(network.cloudflareClient)
|
BilibiliHandler(network.cloudflareClient)
|
||||||
}
|
}
|
||||||
private val azukHandler by lazy {
|
private val azukHandler by lazy {
|
||||||
AzukiHandler(network.client)
|
AzukiHandler(network.client, network.defaultUserAgent)
|
||||||
}
|
}
|
||||||
private val mangaHotHandler by lazy {
|
private val mangaHotHandler by lazy {
|
||||||
MangaHotHandler(network.client)
|
MangaHotHandler(network.client, network.defaultUserAgent)
|
||||||
}
|
}
|
||||||
private val pageHandler by lazy {
|
private val pageHandler by lazy {
|
||||||
PageHandler(
|
PageHandler(
|
||||||
|
@ -3,7 +3,6 @@ package exh.md.handlers
|
|||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.await
|
import eu.kanade.tachiyomi.network.await
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import kotlinx.serialization.json.jsonArray
|
import kotlinx.serialization.json.jsonArray
|
||||||
import kotlinx.serialization.json.jsonObject
|
import kotlinx.serialization.json.jsonObject
|
||||||
@ -13,11 +12,11 @@ import okhttp3.OkHttpClient
|
|||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
|
|
||||||
class AzukiHandler(currentClient: OkHttpClient) {
|
class AzukiHandler(currentClient: OkHttpClient, userAgent: String) {
|
||||||
val baseUrl = "https://www.azuki.co"
|
val baseUrl = "https://www.azuki.co"
|
||||||
private val apiUrl = "https://production.api.azuki.co"
|
private val apiUrl = "https://production.api.azuki.co"
|
||||||
val headers = Headers.Builder()
|
val headers = Headers.Builder()
|
||||||
.add("User-Agent", HttpSource.DEFAULT_USER_AGENT)
|
.add("User-Agent", userAgent)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val client: OkHttpClient = currentClient
|
val client: OkHttpClient = currentClient
|
||||||
|
@ -3,7 +3,6 @@ package exh.md.handlers
|
|||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.await
|
import eu.kanade.tachiyomi.network.await
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
|
||||||
import eu.kanade.tachiyomi.util.asJsoup
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import kotlinx.serialization.json.booleanOrNull
|
import kotlinx.serialization.json.booleanOrNull
|
||||||
@ -16,11 +15,11 @@ import okhttp3.OkHttpClient
|
|||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
|
|
||||||
class ComikeyHandler(cloudflareClient: OkHttpClient) {
|
class ComikeyHandler(cloudflareClient: OkHttpClient, userAgent: String) {
|
||||||
val baseUrl = "https://comikey.com"
|
val baseUrl = "https://comikey.com"
|
||||||
private val apiUrl = "$baseUrl/sapi"
|
private val apiUrl = "$baseUrl/sapi"
|
||||||
val headers = Headers.Builder()
|
val headers = Headers.Builder()
|
||||||
.add("User-Agent", HttpSource.DEFAULT_USER_AGENT)
|
.add("User-Agent", userAgent)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val client: OkHttpClient = cloudflareClient
|
val client: OkHttpClient = cloudflareClient
|
||||||
|
@ -3,7 +3,6 @@ package exh.md.handlers
|
|||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.await
|
import eu.kanade.tachiyomi.network.await
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import kotlinx.serialization.json.jsonArray
|
import kotlinx.serialization.json.jsonArray
|
||||||
import kotlinx.serialization.json.jsonObject
|
import kotlinx.serialization.json.jsonObject
|
||||||
@ -12,11 +11,11 @@ import okhttp3.Headers
|
|||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
|
|
||||||
class MangaHotHandler(currentClient: OkHttpClient) {
|
class MangaHotHandler(currentClient: OkHttpClient, userAgent: String) {
|
||||||
val baseUrl = "https://mangahot.jp"
|
val baseUrl = "https://mangahot.jp"
|
||||||
private val apiUrl = "https://api.mangahot.jp"
|
private val apiUrl = "https://api.mangahot.jp"
|
||||||
val headers = Headers.Builder()
|
val headers = Headers.Builder()
|
||||||
.add("User-Agent", HttpSource.DEFAULT_USER_AGENT)
|
.add("User-Agent", userAgent)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val client: OkHttpClient = currentClient
|
val client: OkHttpClient = currentClient
|
||||||
|
Loading…
x
Reference in New Issue
Block a user