significantly less stupid cloudflare cookie detection in EH
(cherry picked from commit 31e2e62cd3a262b9b194ffd2049e601617bd1aac)
This commit is contained in:
parent
5e3915eae8
commit
d01903ff34
1 changed files with 10 additions and 3 deletions
|
|
@ -963,9 +963,16 @@ class EHentai(
|
|||
.addInterceptor { chain ->
|
||||
val cfCookies = chain.request().header("Cookie")?.split("; ")
|
||||
?.filter {
|
||||
val name = it.split("=")[0].trim().lowercase()
|
||||
name in arrayOf("cf_clearance", "__cf_bm", "cf_chl_prog", "_cfuvid", "__cfruid", "__cflb", "cf_ob_info", "cf_use_ob", "__cfwaitingroom", "__cfseq", "cf_chl_rc_i", "cf_chl_rc_ni", "cf_chl_rc_m") || name.startsWith("cf_chl_seq_")
|
||||
}?.associate { it.split("=")[0].trim() to it.split("=")[1].trim() }
|
||||
// KMK -->
|
||||
// Only accept cookie in form of name=value
|
||||
if (!it.contains("=")) return@filter false
|
||||
val name = it.substringBefore("=").trim().lowercase()
|
||||
// KMK <--
|
||||
name.startsWith("cf") || name.startsWith("_cf") || name.startsWith("__cf")
|
||||
}
|
||||
// KMK -->
|
||||
?.associate { it.substringBefore("=").trim() to it.substringAfter("=").trim() }
|
||||
// KMK <--
|
||||
|
||||
val newReq =
|
||||
chain
|
||||
|
|
|
|||
Loading…
Reference in a new issue