added Kissasian & fixed Movierulzhd

This commit is contained in:
hexated 2022-09-14 00:19:36 +07:00
parent 4ecddc50a6
commit f9aef12a03
8 changed files with 186 additions and 7 deletions

View file

@ -0,0 +1,23 @@
// use an integer for version numbers
version = 1
cloudstream {
language = "en"
// All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum"
authors = listOf("Hexated")
/**
* Status int as the following:
* 0: Down
* 1: Ok
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf("AsianDrama",)
iconUrl = "https://www.google.com/s2/favicons?domain=kissasian.pe&sz=%size%"
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.hexated"/>

View file

@ -0,0 +1,138 @@
package com.hexated
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
class Kissasian : MainAPI() {
override var mainUrl = "https://kissasian.pe"
override var name = "Kissasian"
override val hasMainPage = true
override val hasDownloadSupport = true
override val supportedTypes = setOf(TvType.AsianDrama)
companion object {
fun getStatus(t: String?): ShowStatus {
return when (t) {
"Completed" -> ShowStatus.Completed
"Ongoing" -> ShowStatus.Ongoing
else -> ShowStatus.Completed
}
}
}
override val mainPage = mainPageOf(
"drama-list/ongoing.html?page=" to "Drama Ongoing",
"drama-list/completed.html?page=" to "Drama Completed",
"genre/variety/?page=" to "Variety Show",
"genre/romance/?page=" to "Romance",
"genre/action/?page=" to "Action",
"genre/mystery/?page=" to "Mystery",
)
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val document = app.get("$mainUrl/${request.data}$page").document
val home = document.select("div.list-drama div.item").mapNotNull {
it.toSearchResult()
}
return newHomePageResponse(request.name, home)
}
private fun Element.toSearchResult(): SearchResponse? {
val href = fixUrl(this.selectFirst("a")?.attr("href") ?: return null)
val title = this.selectFirst("span.title")?.text()?.trim() ?: return null
val posterUrl = fixUrlNull(this.selectFirst("div.pic img")?.attr("src"))
return newTvSeriesSearchResponse(title, href, TvType.AsianDrama) {
this.posterUrl = posterUrl
}
}
override suspend fun search(query: String): List<SearchResponse> {
val document = app.get("$mainUrl/search.html?keyword=$query").document
return document.select("div.list-drama div.item").mapNotNull {
it.toSearchResult()
}
}
override suspend fun load(url: String): LoadResponse? {
val document = app.get(url).document
val title = document.selectFirst("div.barContentInfo a")?.text()?.trim() ?: return null
val poster = fixUrlNull(document.selectFirst("div.barContentInfo img")?.attr("src"))
val tags = document.select("div.barContentInfo p:contains(Genres:) a").map { it.text().removePrefix(",").trim() }
val year = document.selectFirst("div.barContentInfo p.type.Releasea")?.text()?.trim()?.toIntOrNull()
val status = getStatus(document.selectFirst("div.barContentInfo p:contains(Status:)")?.ownText()?.trim())
val description = document.selectFirst("div.barContentInfo p.des")?.nextElementSiblings()?.select("p")?.text()
val episodes = document.select("ul.listing li").map {
val name = it.selectFirst("a")?.attr("title")
val link = fixUrlNull(it.selectFirst("a")?.attr("href"))
val epNum = Regex("Episode\\s([0-9]+)").find("$name")?.groupValues?.getOrNull(1)?.toIntOrNull()
newEpisode(link) {
this.name = name
this.episode = epNum
}
}.reversed()
if (episodes.size == 1) {
return newMovieLoadResponse(title, url, TvType.Movie, episodes[0].data) {
posterUrl = poster
this.year = year
plot = description
this.tags = tags
}
} else {
return newTvSeriesLoadResponse(title, url, TvType.AsianDrama, episodes = episodes) {
posterUrl = poster
this.year = year
showStatus = status
plot = description
this.tags = tags
}
}
}
private suspend fun invokeDembedSource(
url: String,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val document = app.get(url).document
document.select("ul.list-server-items li").map {
val iframe = it.attr("data-video").substringBefore("=http")
loadExtractor(iframe, "$mainUrl/", subtitleCallback, callback)
}
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
val document = app.get(data).document
document.select("select#selectServer option").apmap {
safeApiCall {
val iframe = fixUrl(it.attr("value"))
when {
iframe.startsWith("https://dembed2.com") -> invokeDembedSource(
iframe,
subtitleCallback,
callback
)
else -> loadExtractor(iframe, "$mainUrl/", subtitleCallback, callback)
}
}
}
return true
}
}

View file

@ -0,0 +1,14 @@
package com.hexated
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class KissasianPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(Kissasian())
}
}

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

@ -9,7 +9,7 @@ import org.jsoup.Jsoup
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
class LayarKacaProvider : MainAPI() { class LayarKacaProvider : MainAPI() {
override var mainUrl = "https://lk21.homes" override var mainUrl = "https://lk21.cloud"
override var name = "LayarKaca" override var name = "LayarKaca"
override val hasMainPage = true override val hasMainPage = true
override var lang = "id" override var lang = "id"

View file

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

View file

@ -175,14 +175,16 @@ class Movierulzhd : MainAPI() {
referer = url, referer = url,
).text ).text
val mapped = urltext.let { AppUtils.parseJson<Main>(it) } val mapped = urltext.let { AppUtils.parseJson<Main>(it) }
val testurl = app.get(mapped.streamData.file, headers = headers).text callback.invoke(
if (urltext.contains("m3u8") && testurl.contains("EXTM3U")) ExtractorLink(
M3u8Helper.generateM3u8( name,
name, name,
mapped.streamData.file, mapped.streamData.file,
url, url,
Qualities.Unknown.value,
headers = headers headers = headers
).forEach(callback) )
)
} }
override suspend fun loadLinks( override suspend fun loadLinks(