diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt index d56d9def..c90289a6 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt @@ -18,8 +18,11 @@ private const val PAGE_SIZE_SEARCH = 50 private const val NSFW_ALERT = "сексуальные сцены" private const val NOTHING_FOUND = "Ничего не найдено" -internal abstract class GroupleParser(source: MangaSource, userAgent: String) : MangaParser(source), - MangaParserAuthProvider { +internal abstract class GroupleParser( + source: MangaSource, + userAgent: String, + private val siteId: Int, +) : MangaParser(source), MangaParserAuthProvider { private val headers = Headers.Builder() .add("User-Agent", userAgent) @@ -33,7 +36,10 @@ internal abstract class GroupleParser(source: MangaSource, userAgent: String) : ) override val authUrl: String - get() = "https://grouple.co/internal/auth/login" + get() { + val targetUri = "https://${getDomain()}/".urlEncoded() + return "https://grouple.co/internal/auth/sso?siteId=$siteId&=targetUri=$targetUri" + } override val isAuthorized: Boolean get() = context.cookieJar.getCookies(getDomain()).any { it.name == "gwt" } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/MintMangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/MintMangaParser.kt index 8053907e..379143aa 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/MintMangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/MintMangaParser.kt @@ -7,11 +7,11 @@ import org.koitharu.kotatsu.parsers.model.MangaSource @MangaSourceParser("MINTMANGA", "MintManga", "ru") internal class MintMangaParser( - override val context: MangaLoaderContext, -) : GroupleParser(MangaSource.MINTMANGA, "mintmangafun") { + override val context: MangaLoaderContext, +) : GroupleParser(MangaSource.MINTMANGA, "mintmangafun", 2) { override val configKeyDomain = ConfigKey.Domain( - "mintmanga.live", - arrayOf("mintmanga.live", "mintmanga.com"), - ) + "mintmanga.live", + arrayOf("mintmanga.live", "mintmanga.com"), + ) } \ No newline at end of file diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/ReadmangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/ReadmangaParser.kt index 25502347..bd7fa65f 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/ReadmangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/ReadmangaParser.kt @@ -8,7 +8,7 @@ import org.koitharu.kotatsu.parsers.model.MangaSource @MangaSourceParser("READMANGA_RU", "ReadManga", "ru") internal class ReadmangaParser( override val context: MangaLoaderContext, -) : GroupleParser(MangaSource.READMANGA_RU, "readmangafun") { +) : GroupleParser(MangaSource.READMANGA_RU, "readmangafun", 1) { override val configKeyDomain = ConfigKey.Domain( "readmanga.io", diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/SelfMangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/SelfMangaParser.kt index c14faec2..ca4fa65b 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/SelfMangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/SelfMangaParser.kt @@ -7,8 +7,8 @@ import org.koitharu.kotatsu.parsers.model.MangaSource @MangaSourceParser("SELFMANGA", "SelfManga", "ru") internal class SelfMangaParser( - override val context: MangaLoaderContext, -) : GroupleParser(MangaSource.SELFMANGA, "selfmangafun") { + override val context: MangaLoaderContext, +) : GroupleParser(MangaSource.SELFMANGA, "selfmangafun", 3) { override val configKeyDomain = ConfigKey.Domain("selfmanga.live", null) } \ No newline at end of file