YuriMoonSub: Fix chapter url (#4670)

Fix url chapter
This commit is contained in:
Chopper 2024-08-18 06:27:25 -03:00 committed by Draff
parent ac53bd65ff
commit 971007cde7
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 23 additions and 2 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.YuriMoonSub' extClass = '.YuriMoonSub'
themePkg = 'zeistmanga' themePkg = 'zeistmanga'
baseUrl = 'https://yurimoonsub.blogspot.com' baseUrl = 'https://yurimoonsub.blogspot.com'
overrideVersionCode = 0 overrideVersionCode = 1
isNsfw = true isNsfw = true
} }

View File

@ -2,9 +2,30 @@ package eu.kanade.tachiyomi.extension.ar.yurimoonsub
import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga
import eu.kanade.tachiyomi.network.interceptor.rateLimit 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() override val client = super.client.newBuilder()
.rateLimit(2) .rateLimit(2)
.build() .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()
}
} }