From f8992457dce8311f92565b2da3a38745a4007137 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Sun, 29 Jun 2025 16:26:27 +0300 Subject: [PATCH] Update domains --- .../parsers/site/ru/grouple/GroupleParser.kt | 2 +- .../site/ru/grouple/ReadmangaParser.kt | 1 + .../parsers/site/ru/multichan/ChanParser.kt | 24 +++++++++++++++---- .../site/ru/multichan/YaoiChanParser.kt | 2 ++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt index 79b54d23..456f2163 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt @@ -71,7 +71,7 @@ internal abstract class GroupleParser( override val authUrl: String get() { val targetUri = "https://${domain}/".urlEncoded() - return "https://grouple.co/internal/auth/sso?siteId=$siteId&=targetUri=$targetUri" + return "https://3.grouple.co/internal/auth/sso?siteId=$siteId&=targetUri=$targetUri" } override suspend fun isAuthorized(): Boolean = hasAuthCookie() diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/ReadmangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/ReadmangaParser.kt index 37ba44fa..40c4bc68 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/ReadmangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/ReadmangaParser.kt @@ -19,6 +19,7 @@ internal class ReadmangaParser( companion object { val domains = arrayOf( + "t.readmanga.io", "zz.readmanga.io", "readmanga.live", "readmanga.io", diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/ChanParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/ChanParser.kt index f625a86d..74e2aac2 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/ChanParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/ChanParser.kt @@ -1,7 +1,9 @@ package org.koitharu.kotatsu.parsers.site.ru.multichan import okhttp3.HttpUrl +import okhttp3.HttpUrl.Companion.toHttpUrl import org.jsoup.internal.StringUtil +import org.jsoup.nodes.Element import org.koitharu.kotatsu.parsers.MangaLoaderContext import org.koitharu.kotatsu.parsers.MangaParserAuthProvider import org.koitharu.kotatsu.parsers.core.LegacyMangaParser @@ -54,7 +56,7 @@ internal abstract class ChanParser( "/mangaka", ).firstOrNull()?.text() Manga( - id = generateUid(href), + id = generateUid(a.attrAsRelativeUrlAnyHost("href")), url = href, publicUrl = href.toAbsoluteUrl(a.host ?: domain), altTitles = setOfNotNull(title.second), @@ -87,10 +89,10 @@ internal abstract class ChanParser( description = root.getElementById("description")?.html()?.substringBeforeLast(" - val href = tr.selectFirst("a")?.attrAsRelativeUrlOrNull("href") - ?: return@mapChapters null + val a = tr.selectFirst("a") + val href = a?.attrAsRelativeUrlOrNull("href") ?: return@mapChapters null MangaChapter( - id = generateUid(href), + id = generateUid(a.attrAsRelativeUrlAnyHost("href")), title = tr.selectFirst("a")?.textOrNull(), number = i + 1f, volume = 0, @@ -170,7 +172,7 @@ internal abstract class ChanParser( "/mangaka", ).firstOrNull()?.text() Manga( - id = generateUid(href), + id = generateUid(a.attrAsRelativeUrlAnyHost("href")), url = href, publicUrl = href.toAbsoluteUrl(a.host ?: domain), altTitles = setOfNotNull(title.second), @@ -256,4 +258,16 @@ internal abstract class ChanParser( } return this to null } + + private fun Element.attrAsRelativeUrlAnyHost(attributeKey: String): String { + val attr = attr(attributeKey) + if (attr.isEmpty() || attr.startsWith("data:")) { + throw IllegalArgumentException("Wrong url $attr") + } + if (attr.startsWith('/')) { + return attr + } + val host = attr.toHttpUrl().host + return attr.substringAfter(host) + } } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/YaoiChanParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/YaoiChanParser.kt index 848002a7..503086fe 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/YaoiChanParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/multichan/YaoiChanParser.kt @@ -13,6 +13,8 @@ import org.koitharu.kotatsu.parsers.util.* internal class YaoiChanParser(context: MangaLoaderContext) : ChanParser(context, MangaParserSource.YAOICHAN) { override val configKeyDomain = ConfigKey.Domain( + "v9.yaoi-chan.me", + "v10.yaoi-chan.me", "v3.yaoi-chan.me", "v2.yaoi-chan.me", "v1.yaoi-chan.me",