diff --git a/Gomov/build.gradle.kts b/Gomov/build.gradle.kts index 837dc654..ad4a954f 100644 --- a/Gomov/build.gradle.kts +++ b/Gomov/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.konan.properties.Properties // use an integer for version numbers -version = 20 +version = 21 android { defaultConfig { @@ -15,7 +15,7 @@ cloudstream { language = "id" // All of these properties are optional, you can safely remove them - description = "Includes: DutaMovie, Ngefilm, Nodrakorid, Multiplex" + description = "Includes: DutaMovie, Ngefilm, Nodrakorid, Multiplex, Pusatfilm" authors = listOf("Hexated") /** diff --git a/Gomov/src/main/kotlin/com/hexated/Extractors.kt b/Gomov/src/main/kotlin/com/hexated/Extractors.kt index 696d48e8..43619d7e 100644 --- a/Gomov/src/main/kotlin/com/hexated/Extractors.kt +++ b/Gomov/src/main/kotlin/com/hexated/Extractors.kt @@ -3,16 +3,60 @@ package com.hexated import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.ErrorLoadingException import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.base64Decode import com.lagradost.cloudstream3.extractors.* import com.lagradost.cloudstream3.extractors.helper.AesHelper import com.lagradost.cloudstream3.utils.AppUtils +import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.M3u8Helper +import com.lagradost.cloudstream3.utils.loadExtractor import org.jsoup.nodes.Document import org.mozilla.javascript.Context import org.mozilla.javascript.Scriptable +open class Uplayer : ExtractorApi() { + override val name = "Uplayer" + override val mainUrl = "https://uplayer.xyz" + override val requiresReferer = true + + override suspend fun getUrl( + url: String, + referer: String?, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val res = app.get(url,referer=referer).text + val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(res)?.groupValues?.getOrNull(1) + M3u8Helper.generateM3u8( + name, + m3u8 ?: return, + mainUrl + ).forEach(callback) + } + +} + +open class Kotakajaib : ExtractorApi() { + override val name = "Kotakajaib" + override val mainUrl = "https://kotakajaib.me" + override val requiresReferer = true + + override suspend fun getUrl( + url: String, + referer: String?, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + app.get(url,referer=referer).document.select("ul#dropdown-server li a").apmap { + loadExtractor(base64Decode(it.attr("data-frame")), "$mainUrl/", subtitleCallback, callback) + } + } + +} + class Doods : DoodLaExtractor() { override var name = "Doods" override var mainUrl = "https://doods.pro" diff --git a/Gomov/src/main/kotlin/com/hexated/Gomov.kt b/Gomov/src/main/kotlin/com/hexated/Gomov.kt index 51cdc39d..e342bed1 100644 --- a/Gomov/src/main/kotlin/com/hexated/Gomov.kt +++ b/Gomov/src/main/kotlin/com/hexated/Gomov.kt @@ -191,10 +191,9 @@ open class Gomov : MainAPI() { } fun String?.fixImageQuality(): String? { - if(this == null) return null - val regex = Regex("(-\\d*x\\d*)").find(this)?.groupValues - if(regex?.isEmpty() == true) return this - return this.replace(regex?.get(0) ?: return null, "") + if (this == null) return null + val regex = Regex("(-\\d*x\\d*)").find(this)?.groupValues?.get(0) ?: return this + return this.replace(regex, "") } fun getBaseUrl(url: String): String { diff --git a/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt b/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt index 517fee2a..a7b0c2b1 100644 --- a/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt +++ b/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt @@ -14,6 +14,7 @@ class GomovPlugin: Plugin() { registerMainAPI(Ngefilm()) registerMainAPI(Nodrakorid()) registerMainAPI(Multiplex()) + registerMainAPI(Pusatfilm()) registerExtractorAPI(FilelionsTo()) registerExtractorAPI(Likessb()) registerExtractorAPI(DbGdriveplayer()) @@ -22,5 +23,7 @@ class GomovPlugin: Plugin() { registerExtractorAPI(Doods()) registerExtractorAPI(Lylxan()) registerExtractorAPI(FilelionsOn()) + registerExtractorAPI(Kotakajaib()) + registerExtractorAPI(Uplayer()) } } \ No newline at end of file diff --git a/Gomov/src/main/kotlin/com/hexated/Pusatfilm.kt b/Gomov/src/main/kotlin/com/hexated/Pusatfilm.kt new file mode 100644 index 00000000..005e5173 --- /dev/null +++ b/Gomov/src/main/kotlin/com/hexated/Pusatfilm.kt @@ -0,0 +1,41 @@ +package com.hexated + +import com.lagradost.cloudstream3.Episode +import com.lagradost.cloudstream3.LoadResponse +import com.lagradost.cloudstream3.TvSeriesLoadResponse +import com.lagradost.cloudstream3.* + +class Pusatfilm : Gomov() { + override var mainUrl = "https://tv.pusatfilm21.wiki" + override var name = "Pusatfilm" + + override val mainPage = mainPageOf( + "film-terbaru/page/%d/" to "Film Terbaru", + "series-terbaru/page/%d/" to "Series Terbaru", + "drama-korea/page/%d/" to "Drama Korea", + "drama-china/page/%d/" to "Drama China", + ) + + override suspend fun load(url: String): LoadResponse { + return super.load(url).apply { + when (this) { + is TvSeriesLoadResponse -> { + val document = app.get(url).document + this.episodes = document.select("div.vid-episodes a, div.gmr-listseries a").map { eps -> + val href = fixUrl(eps.attr("href")) + val name = eps.attr("title") + val episode = "Episode\\s*(\\d+)".toRegex().find(name)?.groupValues?.get(1) + val season = "Season\\s*(\\d+)".toRegex().find(name)?.groupValues?.get(1) + Episode( + href, + name, + season = season?.toIntOrNull(), + episode = episode?.toIntOrNull(), + ) + }.filter { it.episode != null } + } + } + } + } + +} \ No newline at end of file