Merge pull request #3 from hexated/provider

fixed Gomunime
This commit is contained in:
Osten 2022-08-25 02:13:23 +00:00 committed by GitHub
commit 912f3f4efe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 21 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 1 version = 2
cloudstream { cloudstream {
@ -7,7 +7,7 @@ cloudstream {
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum" // description = "Lorem Ipsum"
// authors = listOf("Cloudburst") authors = listOf("Hexated")
/** /**
* Status int as the following: * Status int as the following:

View file

@ -25,6 +25,9 @@ class GomunimeProvider : MainAPI() {
) )
companion object { companion object {
private const val mainServer = "https://path.onicdn.xyz/app/rapi.php"
fun getType(t: String): TvType { fun getType(t: String): TvType {
return if (t.contains("OVA") || t.contains("Special")) TvType.OVA return if (t.contains("OVA") || t.contains("Special")) TvType.OVA
else if (t.contains("Movie")) TvType.AnimeMovie else if (t.contains("Movie")) TvType.AnimeMovie
@ -152,14 +155,16 @@ class GomunimeProvider : MainAPI() {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
val document = app.get(data).document val document = app.get(data).document
val scriptData = document.select("aside.sidebar > script").dataNodes().toString() val scriptData = document.select("aside.sidebar > script").dataNodes().toString()
val key = scriptData.substringAfter("var a_ray = '").substringBefore("';") val key = scriptData.substringAfter("var a_ray = '").substringBefore("';")
val title = scriptData.substringAfter("var judul_postingan = \"").substringBefore("\";") val title = scriptData.substringAfter("var judul_postingan = \"").substringBefore("\";")
.replace(" ", "+")
val image = document.select("img#tempvid").last()?.attr("src").toString()
val sources: List<Pair<String, String>> = app.post( val sources: List<Pair<String, String>> = app.post(
url = "https://path.gomuni.me/app/vapi.php", url = mainServer,
data = mapOf("data" to key, "judul" to title, "func" to "mirror") data = mapOf("data" to key, "gambar" to image, "judul" to title, "func" to "mirror"),
referer = "$mainUrl/"
).document.select("div.gomunime-server-mirror").map { ).document.select("div.gomunime-server-mirror").map {
Pair( Pair(
it.attr("data-vhash"), it.attr("data-vhash"),
@ -171,24 +176,25 @@ class GomunimeProvider : MainAPI() {
safeApiCall { safeApiCall {
when { when {
it.second.contains("frame") -> { it.second.contains("frame") -> {
loadExtractor(it.first, data, subtitleCallback, callback) loadExtractor(it.first, mainUrl, 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)
}
} }
// 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") -> { it.second.contains("mp4") -> {
app.post( app.post(
url = "https://path.gomuni.me/app/vapi.php", url = mainServer,
data = mapOf("data" to it.first, "func" to "blogs") data = mapOf("data" to it.first, "func" to "blogs")
).parsed<List<MobiSource>>().map { ).parsed<List<MobiSource>>().map {
callback.invoke( callback.invoke(