MangaHub: clear api key cookie ()

This commit is contained in:
Slowlife 2023-05-14 09:40:23 +07:00 committed by GitHub
parent 816f406e0e
commit 5807bebf6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions
multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangahub

View File

@ -99,7 +99,7 @@ abstract class MangaHub(
val cookie = client.cookieJar
.loadForRequest(baseUrl.toHttpUrl())
.firstOrNull { it.name == "mhub_access" }
.firstOrNull { it.name == "mhub_access" && it.value.isNotEmpty() }
val request =
if (originalRequest.url.toString() == "$baseApiUrl/graphql" && cookie != null) {
@ -127,6 +127,10 @@ abstract class MangaHub(
baseUrl.toHttpUrl()
}
// Clear key cookie
val cookie = Cookie.parse(url, "mhub_access=; Max-Age=0; Path=/")!!
client.cookieJar.saveFromResponse(url, listOf(cookie))
// Set required cookie (for cache busting?)
val recently = buildJsonObject {
putJsonObject((now - (0..3600).random()).toString()) {

View File

@ -9,7 +9,7 @@ class MangaHubGenerator : ThemeSourceGenerator {
override val themeClass = "MangaHub"
override val baseVersionCode: Int = 20
override val baseVersionCode: Int = 21
override val sources = listOf(
// SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"),