- Kuramanime
- Rebahin
- Yomovies
added :
- Kitanonton
This commit is contained in:
hexated 2022-10-03 21:22:01 +07:00
parent a6cc814294
commit 91f18d14dc
11 changed files with 173 additions and 69 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 2 version = 3
cloudstream { cloudstream {

View file

@ -1,8 +1,11 @@
package com.hexated package com.hexated
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.Jsoup import org.jsoup.Jsoup
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
@ -132,24 +135,26 @@ class KuramanimeProvider : MainAPI() {
} }
override suspend fun loadLinks( private suspend fun invokeLocalSource(
data: String, url: String,
isCasting: Boolean, ref: String,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ) {
val servers = app.get(data).document val document = app.get(
servers.select("video#player > source").map { url,
suspendSafeApiCall { referer = ref,
val url = it.attr("src") headers = mapOf("X-Requested-With" to "XMLHttpRequest")
val quality = it.attr("size").toInt() ).document
document.select("video#player > source").map {
val link = fixUrl(it.attr("src"))
val quality = it.attr("size").toIntOrNull()
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
name, name,
name, name,
url, link,
referer = "$mainUrl/", referer = "$mainUrl/",
quality = quality, quality = quality ?: Qualities.Unknown.value,
headers = mapOf( headers = mapOf(
"Range" to "bytes=0-" "Range" to "bytes=0-"
) )
@ -158,6 +163,31 @@ class KuramanimeProvider : MainAPI() {
} }
} }
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
val res = app.get(data).document
res.select("select#changeServer option").apmap { source ->
safeApiCall {
val server = source.attr("value")
val link = "$data?activate_stream=1&stream_server=$server"
if (server == "kuramadrive") {
invokeLocalSource(link, data, callback)
} else {
app.get(
link,
referer = data,
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
).document.select("div.iframe-container iframe").attr("src").let { videoUrl ->
loadExtractor(fixUrl(videoUrl), "$mainUrl/", subtitleCallback, callback)
}
}
}
}
return true return true
} }

View file

@ -10,5 +10,6 @@ class KuramanimeProviderPlugin: Plugin() {
override fun load(context: Context) { override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly. // All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(KuramanimeProvider()) registerMainAPI(KuramanimeProvider())
registerExtractorAPI(Nyomo())
} }
} }

View file

@ -0,0 +1,7 @@
package com.hexated
import com.lagradost.cloudstream3.extractors.StreamSB
class Nyomo : StreamSB() {
override var mainUrl = "https://nyomo.my.id"
}

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 1 version = 2
cloudstream { cloudstream {

View file

@ -0,0 +1,32 @@
package com.hexated
import com.lagradost.cloudstream3.*
class Kitanonton : RebahinProvider() {
override var mainUrl = "https://124.150.139.91"
override var name = "KitaNonton"
override var mainServer = "https://199.87.210.226"
override val mainPage = mainPageOf(
"$mainUrl/genre/populer/page/" to "Populer Movies",
"$mainUrl/movies/page/" to "New Movies",
"$mainUrl/genre/westseries/page/" to "West TV Series",
"$mainUrl/genre/drama-korea/page/" to "Drama Korea",
"$mainUrl/genre/animation/page/" to "Anime",
"$mainUrl/genre/series-indonesia/page/" to "Drama Indonesia",
"$mainUrl/genre/drama-jepang/page/" to "Drama Jepang",
"$mainUrl/genre/drama-china/page/" to "Drama China",
"$mainUrl/genre/thailand-series/page/" to "Drama Thailand",
)
override suspend fun getMainPage(
page: Int,
request: MainPageRequest
): HomePageResponse {
val document = app.get(request.data + page).document
val home = document.select("div#featured div.ml-item").mapNotNull {
it.toSearchResult()
}
return newHomePageResponse(request.name, home)
}
}

View file

@ -7,19 +7,18 @@ import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.mvvm.safeApiCall import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.network.WebViewResolver import com.lagradost.cloudstream3.network.WebViewResolver
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.getQualityFromName
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.net.URI import java.net.URI
class RebahinProvider : MainAPI() { open class RebahinProvider : MainAPI() {
override var mainUrl = "http://104.237.198.194" override var mainUrl = "http://104.237.198.196"
override var name = "Rebahin" override var name = "Rebahin"
override val hasMainPage = true override val hasMainPage = true
override var lang = "id" override var lang = "id"
override val hasDownloadSupport = true override val hasDownloadSupport = true
open var mainServer = "http://172.96.161.72"
override val supportedTypes = setOf( override val supportedTypes = setOf(
TvType.Movie, TvType.Movie,
TvType.TvSeries, TvType.TvSeries,
@ -50,7 +49,7 @@ class RebahinProvider : MainAPI() {
val home = val home =
app.get("$mainUrl/wp-content/themes/indoxxi/ajax-top-$tab.php").document.select( app.get("$mainUrl/wp-content/themes/indoxxi/ajax-top-$tab.php").document.select(
"div.ml-item" "div.ml-item"
).map { ).mapNotNull {
it.toSearchResult() it.toSearchResult()
} }
items.add(HomePageList(header, home)) items.add(HomePageList(header, home))
@ -63,13 +62,13 @@ class RebahinProvider : MainAPI() {
return HomePageResponse(items) return HomePageResponse(items)
} }
private fun Element.toSearchResult(): SearchResponse { fun Element.toSearchResult(): SearchResponse? {
val title = this.selectFirst("span.mli-info > h2")!!.text().trim() val title = this.selectFirst("span.mli-info > h2")?.text() ?: return null
val href = this.selectFirst("a")!!.attr("href") val href = this.selectFirst("a")!!.attr("href")
val type = val type =
if (this.select("span.mli-quality").isNotEmpty()) TvType.Movie else TvType.TvSeries if (this.select("span.mli-quality").isNotEmpty()) TvType.Movie else TvType.TvSeries
return if (type == TvType.Movie) { return if (type == TvType.Movie) {
val posterUrl = this.select("img").attr("src") val posterUrl = fixUrlNull(this.select("img").attr("src"))
val quality = getQualityFromString(this.select("span.mli-quality").text().trim()) val quality = getQualityFromString(this.select("span.mli-quality").text().trim())
newMovieSearchResponse(title, href, TvType.Movie) { newMovieSearchResponse(title, href, TvType.Movie) {
this.posterUrl = posterUrl this.posterUrl = posterUrl
@ -77,7 +76,9 @@ class RebahinProvider : MainAPI() {
} }
} else { } else {
val posterUrl = val posterUrl =
this.select("img").attr("src").ifEmpty { this.select("img").attr("data-original") } fixUrlNull(
this.select("img").attr("src")
.ifEmpty { this.select("img").attr("data-original") })
val episode = val episode =
this.select("div.mli-eps > span").text().replace(Regex("[^0-9]"), "").toIntOrNull() this.select("div.mli-eps > span").text().replace(Regex("[^0-9]"), "").toIntOrNull()
newAnimeSearchResponse(title, href, TvType.TvSeries) { newAnimeSearchResponse(title, href, TvType.TvSeries) {
@ -91,7 +92,7 @@ class RebahinProvider : MainAPI() {
val link = "$mainUrl/?s=$query" val link = "$mainUrl/?s=$query"
val document = app.get(link).document val document = app.get(link).document
return document.select("div.ml-item").map { return document.select("div.ml-item").mapNotNull {
it.toSearchResult() it.toSearchResult()
} }
} }
@ -157,10 +158,15 @@ class RebahinProvider : MainAPI() {
} }
} }
private fun getLanguage(str: String): String {
return when {
str.contains("indonesia", true) || str.contains("bahasa", true) -> "Indonesian"
else -> str
}
}
private suspend fun invokeLokalSource( private suspend fun invokeLokalSource(
url: String, url: String,
name: String,
ref: String,
subCallback: (SubtitleFile) -> Unit, subCallback: (SubtitleFile) -> Unit,
sourceCallback: (ExtractorLink) -> Unit sourceCallback: (ExtractorLink) -> Unit
) { ) {
@ -171,37 +177,35 @@ class RebahinProvider : MainAPI() {
headers = mapOf("Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8") headers = mapOf("Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8")
).document ).document
document.select("script").map { script -> document.select("script").find { it.data().contains("config =") }?.data()?.let { script ->
if (script.data().contains("sources: [")) { Regex("\"file\":\\s?\"(.+.m3u8)\"").find(script)?.groupValues?.getOrNull(1)
val source = tryParseJson<ResponseLocal>( ?.let { link ->
script.data().substringAfter("sources: [").substringBefore("],")
)
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( sourceCallback.invoke(
ExtractorLink( ExtractorLink(
source = name, source = name,
name = name, name = name,
url = source.file.replace("video.m3u8", it), url = link,
referer = ref, referer = "$mainServer/",
quality = getQualityFromName("${it.replace(".m3u8", "")}p"), quality = Qualities.Unknown.value,
isM3u8 = true isM3u8 = true,
headers = mapOf("Accept" to "*/*", "Origin" to mainServer)
) )
) )
} }
val trackJson = script.data().substringAfter("tracks: [").substringBefore("],") val subData =
val track = tryParseJson<List<Tracks>>("[$trackJson]") Regex("\"?tracks\"?:\\s\\n?\\[(.*)],").find(script)?.groupValues?.getOrNull(1)
track?.map { ?: Regex("\"?tracks\"?:\\s\\n?\\[\\s*(?s:(.+)],\\n\\s*\"sources)").find(script)?.groupValues?.getOrNull(
1
)
tryParseJson<List<Tracks>>("[$subData]")?.map {
subCallback.invoke( subCallback.invoke(
SubtitleFile( SubtitleFile(
"Indonesian", getLanguage(it.label ?: return@map null),
(if (it.file.contains(".srt")) it.file else null)!! if (it.file?.contains(".srt") == true) it.file else return@map null
) )
) )
}
} }
} }
} }
@ -233,7 +237,7 @@ class RebahinProvider : MainAPI() {
sources.captions?.map { sources.captions?.map {
subCallback.invoke( subCallback.invoke(
SubtitleFile( SubtitleFile(
if (it.language.lowercase().contains("eng")) it.language else "Indonesian", getLanguage(it.language),
"$domainUrl/asset/userdata/$userData/caption/${it.hash}/${it.id}.srt" "$domainUrl/asset/userdata/$userData/caption/${it.hash}/${it.id}.srt"
) )
) )
@ -251,10 +255,8 @@ class RebahinProvider : MainAPI() {
data.removeSurrounding("[", "]").split(",").map { it.trim() }.apmap { link -> data.removeSurrounding("[", "]").split(",").map { it.trim() }.apmap { link ->
safeApiCall { safeApiCall {
when { when {
link.startsWith("http://172.96.161.72") -> invokeLokalSource( link.startsWith(mainServer) -> invokeLokalSource(
link, link,
this.name,
"http://172.96.161.72/",
subtitleCallback, subtitleCallback,
callback callback
) )
@ -286,16 +288,10 @@ class RebahinProvider : MainAPI() {
return true return true
} }
private data class ResponseLocal(
@JsonProperty("file") val file: String,
@JsonProperty("label") val label: String,
@JsonProperty("type") val type: String?
)
private data class Tracks( private data class Tracks(
@JsonProperty("file") val file: String, @JsonProperty("file") val file: String? = null,
@JsonProperty("label") val label: String?, @JsonProperty("label") val label: String? = null,
@JsonProperty("kind") val kind: String? @JsonProperty("kind") val kind: String? = null
) )
private data class Captions( private data class Captions(

View file

@ -10,5 +10,6 @@ class RebahinProviderPlugin: Plugin() {
override fun load(context: Context) { override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly. // All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(RebahinProvider()) registerMainAPI(RebahinProvider())
registerMainAPI(Kitanonton())
} }
} }

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 6 version = 7
cloudstream { cloudstream {

View file

@ -0,0 +1,36 @@
package com.hexated
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.AppUtils
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper
class SpeedoStream1 : ExtractorApi() {
override val name = "SpeedoStream"
override val mainUrl = "https://speedostream.nl"
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val sources = mutableListOf<ExtractorLink>()
app.get(url, referer = referer).document.select("script").map { script ->
if (script.data().contains("jwplayer(\"vplayer\").setup(")) {
val data = script.data().substringAfter("sources: [")
.substringBefore("],").replace("file", "\"file\"").trim()
AppUtils.tryParseJson<File>(data)?.let {
M3u8Helper.generateM3u8(
name,
it.file,
"$mainUrl/",
).forEach { m3uData -> sources.add(m3uData) }
}
}
}
return sources
}
private data class File(
@JsonProperty("file") val file: String,
)
}

View file

@ -10,5 +10,6 @@ class YomoviesProviderPlugin: Plugin() {
override fun load(context: Context) { override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly. // All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(YomoviesProvider()) registerMainAPI(YomoviesProvider())
registerExtractorAPI(SpeedoStream1())
} }
} }