added KissasianMx & updated Oploverz domain

This commit is contained in:
hexated 2023-08-11 06:39:15 +07:00
parent a0fa64bd7b
commit a4bee8ffdf
7 changed files with 99 additions and 18 deletions

View file

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

View file

@ -1,13 +1,14 @@
package com.hexated
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.extractors.Filesim
import com.lagradost.cloudstream3.extractors.helper.GogoHelper
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.httpsify
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.nodes.Element
class Kissasian : MainAPI() {
open class Kissasian : MainAPI() {
override var mainUrl = "https://kissasian.pe"
override var name = "Kissasian"
override val hasMainPage = true
@ -44,8 +45,7 @@ class Kissasian : MainAPI() {
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"))
val posterUrl = fixUrlNull(this.selectFirst("img")?.attr("src"))
return newTvSeriesSearchResponse(title, href, TvType.AsianDrama) {
this.posterUrl = posterUrl
}
@ -58,18 +58,19 @@ class Kissasian : MainAPI() {
}
}
open val contentInfoClass = "barContentInfo"
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 title = document.selectFirst("div.$contentInfoClass a")?.text()?.trim() ?: return null
val poster = fixUrlNull(document.select("div.$contentInfoClass img").last()?.attr("src"))
val tags = document.select("div.$contentInfoClass 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 year = document.selectFirst("div.$contentInfoClass p.type.Releasea")?.text()?.trim()?.toIntOrNull()
val status = getStatus(document.selectFirst("div.$contentInfoClass p:contains(Status:)")?.ownText()?.trim())
val description = document.selectFirst("div.$contentInfoClass p.des, div.$contentInfoClass p:last-child")?.nextElementSiblings()?.select("p")?.text()
val episodes = document.select("ul.listing li").map {
val episodes = document.select("ul.listing li, table.listing td.episodeSub").map {
val name = it.selectFirst("a")?.attr("title")
val link = fixUrlNull(it.selectFirst("a")?.attr("href"))
val epNum = Regex("Episode\\s(\\d+)").find("$name")?.groupValues?.getOrNull(1)?.toIntOrNull()
@ -138,3 +139,8 @@ class Kissasian : MainAPI() {
}
}
class Kswplayer : Filesim() {
override val name = "Kswplayer"
override var mainUrl = "https://kswplayer.info"
}

View file

@ -0,0 +1,58 @@
package com.hexated
import com.lagradost.cloudstream3.SearchResponse
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.TvType
import com.lagradost.cloudstream3.apmap
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.fixUrl
import com.lagradost.cloudstream3.mainPageOf
import com.lagradost.cloudstream3.newTvSeriesSearchResponse
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
class KissasianMx : Kissasian() {
override var mainUrl = "https://kissasian.mx"
override var name = "KissasianMx"
override val contentInfoClass = "barContent"
override val mainPage = mainPageOf(
"Status/Ongoing?page=" to "Drama Ongoing",
"Status/Completed?page=" to "Drama Completed",
"Status/Completed?page=" to "Drama Completed",
"Genre/Romance?page=" to "Drama Romance",
"Genre/Reality-TV?page=" to "Reality-TV",
"Genre/Mystery?page=" to "Drama Mystery",
"Genre/Movie?page=" to "Movie",
)
override suspend fun search(query: String): List<SearchResponse> {
val document = app.post(
"$mainUrl/Search/SearchSuggest", data = mapOf(
"type" to "Drama",
"keyword" to query,
), headers = mapOf("X-Requested-With" to "XMLHttpRequest")
).document
return document.select("a").mapNotNull {
val href = fixUrl(it.attr("href"))
val title = it.text()
newTvSeriesSearchResponse(title, href, TvType.AsianDrama)
}
}
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 {
val server = it.attr("value")
val iframe = app.get(fixUrl(server ?: return@apmap)).document.selectFirst("div#centerDivVideo iframe")?.attr("src")
loadExtractor(iframe ?: return@apmap, "$mainUrl/", subtitleCallback, callback)
}
return true
}
}

View file

@ -10,5 +10,7 @@ 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())
registerMainAPI(KissasianMx())
registerExtractorAPI(Kswplayer())
}
}

View file

@ -2,6 +2,7 @@ package com.hexated
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.utils.*
import com.lagradost.nicehttp.NiceResponse
import com.lagradost.nicehttp.Requests
import com.lagradost.nicehttp.Session
import kotlinx.coroutines.delay
@ -169,7 +170,7 @@ class Nekopoi : MainAPI() {
link.name,
link.url,
link.referer,
if(link.isM3u8) link.quality else it.first,
if (link.isM3u8) link.quality else it.first,
link.isM3u8,
link.headers,
link.extractorData
@ -226,11 +227,24 @@ class Nekopoi : MainAPI() {
return res.headers["location"]
}
private fun NiceResponse.selectMirror(): String? {
return this.document.selectFirst("script:containsData(#passcheck)")?.data()
?.substringAfter("\"GET\", \"")?.substringBefore("\"")
}
private suspend fun bypassMirrored(url: String?): List<String?> {
val request = session.get(url ?: return emptyList())
delay(2000)
val nextUrl = request.text.substringAfter("\"GET\", \"").substringBefore("\"")
return session.get(fixUrl(nextUrl, mirroredHost)).document.select("table.hoverable tbody tr")
val mirrorUrl = request.selectMirror() ?: run {
val nextUrl = request.document.select("div.col-sm.centered.extra-top a").attr("href")
app.get(nextUrl).selectMirror()
}
return session.get(
fixUrl(
mirrorUrl ?: return emptyList(),
mirroredHost
)
).document.select("table.hoverable tbody tr")
.filter { mirror ->
!mirrorIsBlackList(mirror.selectFirst("img")?.attr("alt"))
}.apmap {
@ -244,7 +258,7 @@ class Nekopoi : MainAPI() {
}
}
private fun mirrorIsBlackList(host: String?) : Boolean {
private fun mirrorIsBlackList(host: String?): Boolean {
return mirrorBlackList.any { it.equals(host, true) }
}
@ -268,7 +282,8 @@ class Nekopoi : MainAPI() {
}
private fun getIndexQuality(str: String?): Int {
return when (val quality = Regex("""(?i)\[(\d+[pk])]""").find(str ?: "")?.groupValues?.getOrNull(1)?.lowercase()) {
return when (val quality =
Regex("""(?i)\[(\d+[pk])]""").find(str ?: "")?.groupValues?.getOrNull(1)?.lowercase()) {
"2k" -> Qualities.P1440.value
else -> getQualityFromName(quality)
}

View file

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

View file

@ -6,7 +6,7 @@ import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
class OploverzProvider : MainAPI() {
override var mainUrl = "https://oploverz.care"
override var mainUrl = "https://oploverz.team"
override var name = "Oploverz"
override val hasMainPage = true
override var lang = "id"