From 8b50c17fbfcc5d45666c75c00d8080b89e922e59 Mon Sep 17 00:00:00 2001 From: hexated Date: Wed, 24 Aug 2022 07:42:13 +0700 Subject: [PATCH] fixed Gomunime --- GomunimeProvider/build.gradle.kts | 6 +-- .../kotlin/com/lagradost/GomunimeProvider.kt | 42 +++++++++++-------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/GomunimeProvider/build.gradle.kts b/GomunimeProvider/build.gradle.kts index be91150..ca320bf 100644 --- a/GomunimeProvider/build.gradle.kts +++ b/GomunimeProvider/build.gradle.kts @@ -1,13 +1,13 @@ // use an integer for version numbers -version = 1 +version = 2 cloudstream { language = "id" // All of these properties are optional, you can safely remove them - // description = "Lorem Ipsum" - // authors = listOf("Cloudburst") +// description = "Lorem Ipsum" + authors = listOf("Hexated") /** * Status int as the following: diff --git a/GomunimeProvider/src/main/kotlin/com/lagradost/GomunimeProvider.kt b/GomunimeProvider/src/main/kotlin/com/lagradost/GomunimeProvider.kt index 30689dc..f8d8a44 100644 --- a/GomunimeProvider/src/main/kotlin/com/lagradost/GomunimeProvider.kt +++ b/GomunimeProvider/src/main/kotlin/com/lagradost/GomunimeProvider.kt @@ -25,6 +25,9 @@ class GomunimeProvider : MainAPI() { ) companion object { + + private const val mainServer = "https://path.onicdn.xyz/app/rapi.php" + fun getType(t: String): TvType { return if (t.contains("OVA") || t.contains("Special")) TvType.OVA else if (t.contains("Movie")) TvType.AnimeMovie @@ -152,14 +155,16 @@ class GomunimeProvider : MainAPI() { callback: (ExtractorLink) -> Unit ): Boolean { val document = app.get(data).document - val scriptData = document.select("aside.sidebar > script").dataNodes().toString() val key = scriptData.substringAfter("var a_ray = '").substringBefore("';") val title = scriptData.substringAfter("var judul_postingan = \"").substringBefore("\";") + .replace(" ", "+") + val image = document.select("img#tempvid").last()?.attr("src").toString() val sources: List> = app.post( - url = "https://path.gomuni.me/app/vapi.php", - data = mapOf("data" to key, "judul" to title, "func" to "mirror") + url = mainServer, + data = mapOf("data" to key, "gambar" to image, "judul" to title, "func" to "mirror"), + referer = "$mainUrl/" ).document.select("div.gomunime-server-mirror").map { Pair( it.attr("data-vhash"), @@ -171,24 +176,25 @@ class GomunimeProvider : MainAPI() { safeApiCall { when { it.second.contains("frame") -> { - loadExtractor(it.first, data, subtitleCallback, callback) - } - it.second.contains("hls") -> { - app.post( - url = "https://path.gomuni.me/app/vapi.php", - data = mapOf("fid" to it.first, "func" to "hls") - ).text.let { link -> - M3u8Helper.generateM3u8( - this.name, - link, - "$mainUrl/", - headers = mapOf("Origin" to mainUrl) - ).forEach(callback) - } + loadExtractor(it.first, mainUrl, subtitleCallback, callback) } + // Skip for now +// it.second.contains("hls") -> { +// app.post( +// url = mainServer, +// data = mapOf("fid" to it.first, "func" to "hls") +// ).text.let { link -> +// M3u8Helper.generateM3u8( +// this.name, +// link, +// "$mainUrl/", +// headers = mapOf("Origin" to mainUrl) +// ).forEach(callback) +// } +// } it.second.contains("mp4") -> { app.post( - url = "https://path.gomuni.me/app/vapi.php", + url = mainServer, data = mapOf("data" to it.first, "func" to "blogs") ).parsed>().map { callback.invoke(