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,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:

View file

@ -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<Pair<String, String>> = 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<List<MobiSource>>().map {
callback.invoke(