diff --git a/lib-multisrc/keyoapp/assets/i18n/messages_ar.properties b/lib-multisrc/keyoapp/assets/i18n/messages_ar.properties new file mode 100644 index 000000000..11feb55ba --- /dev/null +++ b/lib-multisrc/keyoapp/assets/i18n/messages_ar.properties @@ -0,0 +1,4 @@ +pref_show_paid_chapter_title=عرض الفصول المدفوعة +pref_show_paid_chapter_summary_on=سيتم عرض الفصول المدفوعة +pref_show_paid_chapter_summary_off=سيتم عرض الفصول المجانية فقط. +chapter_page_url_not_found=رابط الصفحة غير موجود diff --git a/lib-multisrc/keyoapp/assets/i18n/messages_en.properties b/lib-multisrc/keyoapp/assets/i18n/messages_en.properties index bb835eafb..ab2b83765 100644 --- a/lib-multisrc/keyoapp/assets/i18n/messages_en.properties +++ b/lib-multisrc/keyoapp/assets/i18n/messages_en.properties @@ -1,3 +1,4 @@ pref_show_paid_chapter_title=Display paid chapters pref_show_paid_chapter_summary_on=Paid chapters will appear. pref_show_paid_chapter_summary_off=Only free chapters will be displayed. +chapter_page_url_not_found=Page URL not found diff --git a/lib-multisrc/keyoapp/assets/i18n/messages_fr.properties b/lib-multisrc/keyoapp/assets/i18n/messages_fr.properties new file mode 100644 index 000000000..ccce4cb25 --- /dev/null +++ b/lib-multisrc/keyoapp/assets/i18n/messages_fr.properties @@ -0,0 +1,4 @@ +pref_show_paid_chapter_title=Afficher les chapitres payants +pref_show_paid_chapter_summary_on=Les chapitres payants apparaitront. +pref_show_paid_chapter_summary_off=Seuls les chapitres gratuits apparaitront. +chapter_page_url_not_found=Page URL non trouvée diff --git a/lib-multisrc/keyoapp/build.gradle.kts b/lib-multisrc/keyoapp/build.gradle.kts index 7ef91ecaf..1c041fa3e 100644 --- a/lib-multisrc/keyoapp/build.gradle.kts +++ b/lib-multisrc/keyoapp/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("lib-multisrc") } -baseVersionCode = 8 +baseVersionCode = 9 dependencies { api(project(":lib:i18n")) diff --git a/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt b/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt index f166ed56a..421674653 100644 --- a/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt +++ b/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt @@ -18,7 +18,6 @@ import eu.kanade.tachiyomi.util.asJsoup import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import okhttp3.HttpUrl.Companion.toHttpUrl -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.Request import okhttp3.Response import org.jsoup.nodes.Document @@ -55,7 +54,7 @@ abstract class Keyoapp( protected val intl = Intl( language = lang, baseLanguage = "en", - availableLanguages = setOf("en"), + availableLanguages = setOf("ar", "en", "fr"), classLoader = this::class.java.classLoader!!, ) @@ -259,9 +258,11 @@ abstract class Keyoapp( // Image list override fun pageListParse(document: Document): List { + val cdnUrl = getCdnUrl(document) document.select("#pages > img") .map { it.attr("uid") } .filter { it.isNotEmpty() } + .also { cdnUrl ?: throw Exception(intl["chapter_page_url_not_found"]) } .mapIndexed { index, img -> Page(index, document.location(), "$cdnUrl/$img") } @@ -277,7 +278,16 @@ abstract class Keyoapp( } } - protected open val cdnUrl = "https://2xffbs-cn8.is1.buzz/uploads" + protected open fun getCdnUrl(document: Document): String? { + return document.select("script") + .firstOrNull { CDN_HOST_REGEX.containsMatchIn(it.html()) } + ?.let { + val cdnHost = CDN_HOST_REGEX.find(it.html()) + ?.groups?.get("host")?.value + ?.replace(CDN_CLEAN_REGEX, "") + "https://$cdnHost/uploads" + } + } private val oldImgCdnRegex = Regex("""^(https?:)?//cdn\d*\.keyoapp\.com""") @@ -297,12 +307,7 @@ abstract class Keyoapp( protected open fun Element.getImageUrl(selector: String): String? { return this.selectFirst(selector)?.let { element -> - element.attr("style") - .substringAfter(":url(", "") - .substringBefore(")", "") - .takeIf { it.isNotEmpty() } - ?.toHttpUrlOrNull()?.newBuilder()?.setQueryParameter("w", "480")?.build() - ?.toString() + IMG_REGEX.find(element.attr("style"))?.groups?.get("url")?.value } } @@ -360,5 +365,8 @@ abstract class Keyoapp( companion object { private const val SHOW_PAID_CHAPTERS_PREF = "pref_show_paid_chap" private const val SHOW_PAID_CHAPTERS_DEFAULT = false + val CDN_HOST_REGEX = """realUrl\s*=\s*`[^`]+//(?[^/]+)""".toRegex() + val CDN_CLEAN_REGEX = """\$\{[^}]*\}""".toRegex() + val IMG_REGEX = """url\(['"]?(?[^(['"\)])]+)""".toRegex() } } diff --git a/src/en/arvencomics/src/eu/kanade/tachiyomi/extension/en/arvencomics/ArvenComics.kt b/src/en/arvencomics/src/eu/kanade/tachiyomi/extension/en/arvencomics/ArvenComics.kt index 84c412bf7..b52b1b65e 100644 --- a/src/en/arvencomics/src/eu/kanade/tachiyomi/extension/en/arvencomics/ArvenComics.kt +++ b/src/en/arvencomics/src/eu/kanade/tachiyomi/extension/en/arvencomics/ArvenComics.kt @@ -9,6 +9,4 @@ class ArvenComics : Keyoapp( ) { // migrated from Mangathemesia to Keyoapp override val versionId = 2 - - override val cdnUrl = "https://3xfsjdlc.is1.buzz/uploads" } diff --git a/src/en/ezmanga/src/eu/kanade/tachiyomi/extension/en/ezmanga/EZmanga.kt b/src/en/ezmanga/src/eu/kanade/tachiyomi/extension/en/ezmanga/EZmanga.kt index e88e036ee..a52a663fb 100644 --- a/src/en/ezmanga/src/eu/kanade/tachiyomi/extension/en/ezmanga/EZmanga.kt +++ b/src/en/ezmanga/src/eu/kanade/tachiyomi/extension/en/ezmanga/EZmanga.kt @@ -9,6 +9,4 @@ class EZmanga : Keyoapp( ) { // Migrated from Madara to Keyoapp override val versionId = 2 - - override val cdnUrl = "https://3xfsjdlc.is1.buzz/uploads" } diff --git a/src/en/luascans/src/eu/kanade/tachiyomi/extension/en/luascans/LuaScans.kt b/src/en/luascans/src/eu/kanade/tachiyomi/extension/en/luascans/LuaScans.kt index 3ffea0d33..755bbe32a 100644 --- a/src/en/luascans/src/eu/kanade/tachiyomi/extension/en/luascans/LuaScans.kt +++ b/src/en/luascans/src/eu/kanade/tachiyomi/extension/en/luascans/LuaScans.kt @@ -9,6 +9,4 @@ class LuaScans : Keyoapp( ) { // migrated from MangaThemesia to Keyoapp override val versionId = 2 - - override val cdnUrl = "https://3xfsjdlc.is1.buzz/uploads" } diff --git a/src/en/magusmanga/src/eu/kanade/tachiyomi/extension/en/magusmanga/MagusManga.kt b/src/en/magusmanga/src/eu/kanade/tachiyomi/extension/en/magusmanga/MagusManga.kt index f8cab15eb..5f557d733 100644 --- a/src/en/magusmanga/src/eu/kanade/tachiyomi/extension/en/magusmanga/MagusManga.kt +++ b/src/en/magusmanga/src/eu/kanade/tachiyomi/extension/en/magusmanga/MagusManga.kt @@ -15,12 +15,9 @@ class MagusManga : Keyoapp( ) { override val versionId = 2 - override val cdnUrl = "https://3xfsjdlc.is1.buzz/uploads" - override val client = network.cloudflareClient.newBuilder() .addInterceptor(::captchaInterceptor) .rateLimitHost(baseUrl.toHttpUrl(), 1) - .rateLimitHost(cdnUrl.toHttpUrl(), 1) .build() private fun captchaInterceptor(chain: Interceptor.Chain): Response { diff --git a/src/en/necroscans/src/eu/kanade/tachiyomi/extension/en/necroscans/NecroScans.kt b/src/en/necroscans/src/eu/kanade/tachiyomi/extension/en/necroscans/NecroScans.kt index 74e955e35..70fd95eaa 100644 --- a/src/en/necroscans/src/eu/kanade/tachiyomi/extension/en/necroscans/NecroScans.kt +++ b/src/en/necroscans/src/eu/kanade/tachiyomi/extension/en/necroscans/NecroScans.kt @@ -6,6 +6,4 @@ class NecroScans : Keyoapp( "Necro Scans", "https://necroscans.com", "en", -) { - override val cdnUrl = "https://3xfsjdlc.is1.buzz/uploads" -} +) diff --git a/src/en/rezoscans/src/eu/kanade/tachiyomi/extension/en/rezoscans/RezoScans.kt b/src/en/rezoscans/src/eu/kanade/tachiyomi/extension/en/rezoscans/RezoScans.kt index 32b8b792f..6af18a08b 100644 --- a/src/en/rezoscans/src/eu/kanade/tachiyomi/extension/en/rezoscans/RezoScans.kt +++ b/src/en/rezoscans/src/eu/kanade/tachiyomi/extension/en/rezoscans/RezoScans.kt @@ -6,6 +6,4 @@ class RezoScans : Keyoapp( "Rezo Scans", "https://rezoscans.com", "en", -) { - override val cdnUrl = "https://3xfsjdlc.is1.buzz/uploads" -} +) diff --git a/src/en/wickedscans/build.gradle b/src/en/wickedscans/build.gradle index 296b9cbe8..ae55433f9 100644 --- a/src/en/wickedscans/build.gradle +++ b/src/en/wickedscans/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'Wicked Scans' extClass = '.WickedScans' themePkg = 'keyoapp' - baseUrl = 'https://rudrascans.com' - overrideVersionCode = 0 + baseUrl = 'https://wickedscans.org' + overrideVersionCode = 1 } apply from: "$rootDir/common.gradle" diff --git a/src/en/wickedscans/src/eu/kanade/tachiyomi/extension/en/wickedscans/WickedScans.kt b/src/en/wickedscans/src/eu/kanade/tachiyomi/extension/en/wickedscans/WickedScans.kt index d847405e3..23daab455 100644 --- a/src/en/wickedscans/src/eu/kanade/tachiyomi/extension/en/wickedscans/WickedScans.kt +++ b/src/en/wickedscans/src/eu/kanade/tachiyomi/extension/en/wickedscans/WickedScans.kt @@ -2,4 +2,4 @@ package eu.kanade.tachiyomi.extension.en.wickedscans import eu.kanade.tachiyomi.multisrc.keyoapp.Keyoapp -class WickedScans : Keyoapp("Wicked Scans", "https://wickedscans.com", "en") +class WickedScans : Keyoapp("Wicked Scans", "https://wickedscans.org", "en") diff --git a/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt b/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt index bf86a3e6d..516a7f232 100644 --- a/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt +++ b/src/fr/reaperscans/src/eu/kanade/tachiyomi/extension/fr/reaperscans/ReaperScans.kt @@ -10,6 +10,4 @@ class ReaperScans : Keyoapp( // Migrated from Madara to Keyoapp. override val versionId = 4 - - override val cdnUrl = "https://3xfsjdlc.is1.buzz/uploads" }