fix layarkaca/gomunime/kuronime (#1092)

This commit is contained in:
Hexated 2022-05-27 06:35:37 +07:00 committed by GitHub
parent 9b94853199
commit 509a240e5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 81 additions and 27 deletions

View file

@ -89,7 +89,7 @@ object APIHolder {
TantifilmProvider(),
HDMovie5(),
RebahinProvider(),
LayarKaca21Provider(),
LayarKacaProvider(),
// Metadata providers
//TmdbProvider(),

View file

@ -3,20 +3,11 @@ package com.lagradost.cloudstream3.animeproviders
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
import java.util.*
import com.fasterxml.jackson.module.kotlin.readValue
import com.lagradost.cloudstream3.movieproviders.SflixProvider
import com.lagradost.cloudstream3.movieproviders.SflixProvider.Companion.extractRabbitStream
import com.lagradost.cloudstream3.movieproviders.SflixProvider.Companion.toExtractorLink
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.nicehttp.Requests.Companion.await
import kotlinx.coroutines.runBlocking
import okhttp3.Interceptor
import java.net.URI
class GomunimeProvider : MainAPI() {
override var mainUrl = "https://185.231.223.76"
@ -210,7 +201,8 @@ class GomunimeProvider : MainAPI() {
M3u8Helper.generateM3u8(
this.name,
link,
mainUrl,
"$mainUrl/",
headers = mapOf("Origin" to mainUrl)
).forEach(callback)
}
}

View file

@ -1,6 +1,5 @@
package com.lagradost.cloudstream3.animeproviders
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.mvvm.safeApiCall
@ -157,6 +156,8 @@ class KuronimeProvider : MainAPI() {
val token = data.substringAfter("var token = \"").substringBefore("\";")
val pat = data.substringAfter("var pat = \"").substringBefore("\";")
val link = "$doma$token$pat/index.m3u8"
val quality =
Regex("\\d{3,4}p").find(doc.select("title").text())?.groupValues?.get(0)
sourceCallback.invoke(
ExtractorLink(
@ -164,7 +165,8 @@ class KuronimeProvider : MainAPI() {
this.name,
link,
referer = "https://animeku.org/",
quality = Qualities.Unknown.value,
quality = getQualityFromName(quality),
headers = mapOf("Origin" to "https://animeku.org"),
isM3u8 = true
)
)
@ -186,7 +188,7 @@ class KuronimeProvider : MainAPI() {
sources.apmap {
safeApiCall {
when {
it.contains("animeku.org") -> invokeKuroSource(it, callback)
it.startsWith("https://animeku.org") -> invokeKuroSource(it, callback)
else -> loadExtractor(it, mainUrl, callback)
}
}

View file

@ -1,8 +1,6 @@
package com.lagradost.cloudstream3.animeproviders
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.nodes.Element
@ -33,6 +31,7 @@ class NeonimeProvider : MainAPI() {
return when (t) {
"Ended" -> ShowStatus.Completed
"OnGoing" -> ShowStatus.Ongoing
"Ongoing" -> ShowStatus.Ongoing
"In Production" -> ShowStatus.Ongoing
"Returning Series" -> ShowStatus.Ongoing
else -> ShowStatus.Completed

View file

@ -4,6 +4,7 @@ import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.getQualityFromName
import kotlinx.coroutines.delay
class DoodCxExtractor : DoodLaExtractor() {
@ -40,13 +41,14 @@ open class DoodLaExtractor : ExtractorApi() {
val response0 = app.get(url).text // html of DoodStream page to look for /pass_md5/...
val md5 =mainUrl+(Regex("/pass_md5/[^']*").find(response0)?.value ?: return null) // get https://dood.ws/pass_md5/...
val trueUrl = app.get(md5, referer = url).text + "zUEJeL3mUN?token=" + md5.substringAfterLast("/") //direct link to extract (zUEJeL3mUN is random)
val quality = Regex("\\d{3,4}p").find(response0.substringAfter("<title>").substringBefore("</title>"))?.groupValues?.get(0)
return listOf(
ExtractorLink(
trueUrl,
this.name,
trueUrl,
mainUrl,
Qualities.Unknown.value,
getQualityFromName(quality),
false
)
) // links are valid in 8h

View file

@ -0,0 +1,45 @@
package com.lagradost.cloudstream3.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.getQualityFromName
class Solidfiles : ExtractorApi() {
override val name = "Solidfiles"
override val mainUrl = "https://www.solidfiles.com"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val sources = mutableListOf<ExtractorLink>()
with(app.get(url).document) {
this.select("script").map { script ->
if (script.data().contains("\"streamUrl\":")) {
val data = script.data().substringAfter("constant('viewerOptions', {").substringBefore("});")
val source = tryParseJson<ResponseSource>("{$data}")
val quality = Regex("\\d{3,4}p").find(source!!.nodeName)?.groupValues?.get(0)
sources.add(
ExtractorLink(
name,
name,
source.streamUrl,
referer = url,
quality = getQualityFromName(quality)
)
)
}
}
}
return sources
}
private data class ResponseSource(
@JsonProperty("streamUrl") val streamUrl: String,
@JsonProperty("nodeName") val nodeName: String
)
}

View file

@ -1,23 +1,22 @@
package com.lagradost.cloudstream3.movieproviders
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.httpsify
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
import java.util.*
class LayarKaca21Provider : MainAPI() {
override var mainUrl = "https://149.56.24.226/"
override var name = "LayarKaca21"
class LayarKacaProvider : MainAPI() {
override var mainUrl = "https://149.56.24.226"
override var name = "LayarKaca"
override val hasMainPage = true
override val lang = "id"
override val hasDownloadSupport = true
override val supportedTypes = setOf(
TvType.Movie,
TvType.TvSeries,
TvType.AsianDrama
)
override suspend fun getMainPage(): HomePageResponse {

View file

@ -20,6 +20,8 @@ class RebahinProvider : MainAPI() {
override val supportedTypes = setOf(
TvType.Movie,
TvType.TvSeries,
TvType.Anime,
TvType.AsianDrama
)
override suspend fun getMainPage(): HomePageResponse {
@ -168,6 +170,7 @@ class RebahinProvider : MainAPI() {
private suspend fun invokeLokalSource(
url: String,
name: String,
ref: String,
subCallback: (SubtitleFile) -> Unit,
sourceCallback: (ExtractorLink) -> Unit
) {
@ -182,11 +185,21 @@ class RebahinProvider : MainAPI() {
if (script.data().contains("sources: [")) {
val source = tryParseJson<ResponseLocal>(
script.data().substringAfter("sources: [").substringBefore("],"))
M3u8Helper.generateM3u8(
name,
source!!.file,
"http://172.96.161.72",
).forEach(sourceCallback)
val m3uData = app.get(source!!.file, referer = ref).text
val quality = Regex("\\d{3,4}\\.m3u8").findAll(m3uData).map { it.value }.toList()
quality.forEach {
sourceCallback.invoke(
ExtractorLink(
source = name,
name = name,
url = source.file.replace("video.m3u8", it),
referer = ref,
quality = getQualityFromName("${it.replace(".m3u8", "")}p"),
isM3u8 = true
)
)
}
val trackJson = script.data().substringAfter("tracks: [").substringBefore("],")
val track = tryParseJson<List<Tracks>>("[$trackJson]")
@ -291,6 +304,7 @@ class RebahinProvider : MainAPI() {
it.startsWith("http://172.96.161.72") -> invokeLokalSource(
it,
this.name,
"http://172.96.161.72/",
subtitleCallback,
callback
)

View file

@ -190,6 +190,7 @@ val extractorApis: Array<ExtractorApi> = arrayOf(
GMPlayer(),
Blogger(),
Solidfiles(),
Hxfile(),
KotakAnimeid(),