diff --git a/Samehadaku/build.gradle.kts b/Samehadaku/build.gradle.kts index fc63247e..0cc39157 100644 --- a/Samehadaku/build.gradle.kts +++ b/Samehadaku/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 5 +version = 6 cloudstream { diff --git a/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt b/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt index ac6bc746..02db5fd0 100644 --- a/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt +++ b/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt @@ -101,7 +101,7 @@ class Samehadaku : MainAPI() { } val document = app.get(fixUrl ?: return null).document - val title = document.selectFirst("h1.entry-title")?.text()?.removeSurrounding("Nonton", "Subtitle Indonesia")?.trim() ?: return null + val title = document.selectFirst("h1.entry-title")?.text()?.removeBloat() ?: return null val poster = document.selectFirst("div.thumb > img")?.attr("src") val tags = document.select("div.genre-info > a").map { it.text() } val year = document.selectFirst("div.spe > span:contains(Rilis)")?.ownText()?.let { @@ -180,6 +180,10 @@ class Samehadaku : MainAPI() { return true } + private fun String.removeBloat() : String{ + return this.replace(Regex("(Nonton)|(Anime)|(Subtitle\\sIndonesia)"), "").trim() + } + private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker { val res = app.get("https://api.consumet.org/meta/anilist/$title") .parsedSafe()?.results?.find { media ->