MyReadingManga fix webview block (#6617)
* MyReadingManga fix bug "Not found" * MyReadingManga fix bug "Not found" in view-mode
This commit is contained in:
parent
8b212ffdcd
commit
2430b18af0
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'MyReadingManga'
|
||||
extClass = '.MyReadingMangaFactory'
|
||||
extVersionCode = 53
|
||||
extVersionCode = 54
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import eu.kanade.tachiyomi.source.model.SManga
|
|||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.Headers
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
|
@ -29,10 +28,21 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
|
|||
// Basic Info
|
||||
override val name = "MyReadingManga"
|
||||
final override val baseUrl = "https://myreadingmanga.info"
|
||||
override val client: OkHttpClient = network.cloudflareClient
|
||||
override fun headersBuilder(): Headers.Builder =
|
||||
super.headersBuilder()
|
||||
.set("User-Agent", USER_AGENT)
|
||||
.add("X-Requested-With", randomString((1..20).random()))
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.addInterceptor { chain ->
|
||||
val request = chain.request()
|
||||
val headers = request.headers.newBuilder().apply {
|
||||
removeAll("X-Requested-With")
|
||||
}.build()
|
||||
|
||||
chain.proceed(request.newBuilder().headers(headers).build())
|
||||
}
|
||||
.build()
|
||||
|
||||
override val supportsLatest = true
|
||||
|
||||
// Popular - Random
|
||||
|
@ -321,6 +331,11 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
|
|||
}
|
||||
|
||||
companion object {
|
||||
private const val USER_AGENT = "Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.230 Mobile Safari/537.36"
|
||||
private const val USER_AGENT = "Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36"
|
||||
}
|
||||
|
||||
private fun randomString(length: Int): String {
|
||||
val charPool = ('a'..'z') + ('A'..'Z')
|
||||
return List(length) { charPool.random() }.joinToString("")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue