diff --git a/src/ar/yurimoonsub/build.gradle b/src/ar/yurimoonsub/build.gradle index 16cf17575..87db15a87 100644 --- a/src/ar/yurimoonsub/build.gradle +++ b/src/ar/yurimoonsub/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.YuriMoonSub' themePkg = 'zeistmanga' baseUrl = 'https://yurimoonsub.blogspot.com' - overrideVersionCode = 0 + overrideVersionCode = 1 isNsfw = true } diff --git a/src/ar/yurimoonsub/src/eu/kanade/tachiyomi/extension/ar/yurimoonsub/YuriMoonSub.kt b/src/ar/yurimoonsub/src/eu/kanade/tachiyomi/extension/ar/yurimoonsub/YuriMoonSub.kt index 35793b132..ceadf5234 100644 --- a/src/ar/yurimoonsub/src/eu/kanade/tachiyomi/extension/ar/yurimoonsub/YuriMoonSub.kt +++ b/src/ar/yurimoonsub/src/eu/kanade/tachiyomi/extension/ar/yurimoonsub/YuriMoonSub.kt @@ -2,9 +2,30 @@ package eu.kanade.tachiyomi.extension.ar.yurimoonsub import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga import eu.kanade.tachiyomi.network.interceptor.rateLimit +import org.jsoup.nodes.Document +import java.net.URLDecoder +import java.nio.charset.StandardCharsets -class YuriMoonSub : ZeistManga("Yuri Moon Sub", "https://yurimoonsub.blogspot.com", "ar") { +class YuriMoonSub : ZeistManga( + "Yuri Moon Sub", + "https://yurimoonsub.blogspot.com", + "ar", +) { override val client = super.client.newBuilder() .rateLimit(2) .build() + + override fun getChapterFeedUrl(doc: Document): String { + return URLDecoder.decode(super.getChapterFeedUrl(doc), StandardCharsets.UTF_8.toString()) + .removeArabicChars() + } + + private fun String.removeArabicChars() = + this.replace(ARABIC_CHARS_REGEX, "") + .replace(EXTRA_SPACES_REGEX, "") + + companion object { + val ARABIC_CHARS_REGEX = "[\\u0600-\\u06FF]".toRegex() + val EXTRA_SPACES_REGEX = "\\s{2,}".toRegex() + } }