From 248d51321af09cba1dd5fa6bd3d2e39ca03fdd16 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Sat, 5 Jul 2025 08:41:29 +0300 Subject: [PATCH] [Koharu] Refactor UserAgent --- .../org/koitharu/kotatsu/parsers/network/UserAgents.kt | 3 --- .../kotlin/org/koitharu/kotatsu/parsers/site/all/Koharu.kt | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/network/UserAgents.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/network/UserAgents.kt index 49704fae..636fe9c9 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/network/UserAgents.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/network/UserAgents.kt @@ -14,7 +14,4 @@ public object UserAgents { public const val FIREFOX_DESKTOP: String = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0" public const val KOTATSU: String = "Kotatsu/6.8 (Android 13;;; en)" - - // for Schale.network source - public const val KOHARU: String = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.7204.46 Mobile Safari/537.36" } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/Koharu.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/Koharu.kt index 5972d8f7..0f262a7f 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/Koharu.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/Koharu.kt @@ -8,7 +8,6 @@ import org.koitharu.kotatsu.parsers.MangaSourceParser import org.koitharu.kotatsu.parsers.config.ConfigKey import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser import org.koitharu.kotatsu.parsers.exception.ParseException -import org.koitharu.kotatsu.parsers.network.UserAgents import org.koitharu.kotatsu.parsers.model.* import org.koitharu.kotatsu.parsers.util.* import org.koitharu.kotatsu.parsers.util.json.getIntOrDefault @@ -28,7 +27,9 @@ internal class Koharu(context: MangaLoaderContext) : override val configKeyDomain = ConfigKey.Domain("niyaniya.moe") private val apiSuffix = "api.schale.network" - override val userAgentKey = ConfigKey.UserAgent(UserAgents.KOHARU) + override val userAgentKey = ConfigKey.UserAgent( + "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.7204.46 Mobile Safari/537.36", + ) private val authorsIds = suspendLazy { fetchAuthorsIds() }