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

@ -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)
}