fixed several providers

This commit is contained in:
hexated 2023-03-04 05:37:14 +07:00
parent 8fbd218574
commit 3f2f8d8000
8 changed files with 45 additions and 36 deletions

View file

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

View file

@ -81,6 +81,7 @@ class Hdfilmcehennemi : MainAPI() {
val document = app.get(url).document
val title = document.selectFirst("div.card-header > h1, div.card-header > h2")?.text()
?.removeSuffix("Filminin Bilgileri")?.trim()
?: return null
val poster = fixUrlNull(document.selectFirst("img.img-fluid")?.attr("src"))
val tags = document.select("div.mb-0.lh-lg div:nth-child(5) a").map { it.text() }

View file

@ -25,12 +25,6 @@ class Loklok : MainAPI() {
TvType.AsianDrama,
)
private val headers = mutableMapOf(
"lang" to "en",
"versioncode" to "33",
"clienttype" to "android_tem3",
)
// no license found
// thanks to https://github.com/napthedev/filmhot for providing API
companion object {
@ -38,6 +32,12 @@ class Loklok : MainAPI() {
private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}"
private val searchApi = base64Decode("aHR0cHM6Ly9sb2tsb2suY29t")
private const val mainImageUrl = "https://images.weserv.nl"
private val headers = mutableMapOf(
"lang" to "en",
"versioncode" to "33",
"clienttype" to "android_tem3",
"deviceid" to getDeviceId()
)
private fun base64DecodeAPI(api: String): String {
return api.chunked(4).map { base64Decode(it) }.reversed().joinToString("")
@ -132,8 +132,6 @@ class Loklok : MainAPI() {
headers = headers
).parsedSafe<Load>()?.data ?: throw ErrorLoadingException("Invalid Json Reponse")
headers["deviceid"] = getDevideId()
val actors = res.starList?.mapNotNull {
Actor(
it.localName ?: return@mapNotNull null, it.image
@ -269,13 +267,6 @@ class Loklok : MainAPI() {
}
}
private fun getDevideId(length: Int = 16): String {
val allowedChars = ('a'..'f') + ('0'..'9')
return (1..length)
.map { allowedChars.random() }
.joinToString("")
}
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
val res = app.get("https://api.consumet.org/meta/anilist/$title")
.parsedSafe<AniSearch>()?.results?.find { media ->
@ -428,3 +419,10 @@ class Loklok : MainAPI() {
}
fun getDeviceId(length: Int = 16): String {
val allowedChars = ('a'..'f') + ('0'..'9')
return (1..length)
.map { allowedChars.random() }
.joinToString("")
}

View file

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

View file

@ -5,13 +5,14 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.extractors.Filesim
import com.lagradost.cloudstream3.utils.*
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
import java.util.ArrayList
class OploverzProvider : MainAPI() {
override var mainUrl = "https://15.235.11.45"
override var mainUrl = "https://oploverz.tv"
override var name = "Oploverz"
override val hasMainPage = true
override var lang = "id"
@ -25,7 +26,8 @@ class OploverzProvider : MainAPI() {
companion object {
const val acefile = "https://acefile.co"
const val linkbox = "https://lbx.to"
const val lbx = "https://lbx.to"
const val linkbox = "https://www.linkbox.to"
fun getType(t: String): TvType {
return when {
@ -200,13 +202,13 @@ class OploverzProvider : MainAPI() {
if (streamingSources.isNotEmpty()) sources.addAll(streamingSources)
val downloadSources =
document.select("div.bixbox div.soraddlx.soradlg").lastOrNull()?.select("div.soraurlx")
?.map { item ->
document.select("div.mctnx div:contains(mp4) div.soraurlx").mapNotNull { item ->
item.select("a").map { item.select("strong").text() to it.attr("href") }
}?.flatten()
if (downloadSources?.isNotEmpty() == true) sources.addAll(downloadSources)
}.flatten()
if (downloadSources.isNotEmpty()) sources.addAll(downloadSources)
sources.apmap { (quality, source) ->
sources.filter { it.second.startsWith("https") }.
apmap { (quality, source) ->
loadExtractor(fixedIframe(source), data, subtitleCallback) { link ->
callback.invoke(
ExtractorLink(
@ -226,11 +228,14 @@ class OploverzProvider : MainAPI() {
return true
}
private fun fixedIframe(url: String): String {
val id = Regex("""/f/(\S+)/|/file/(\S+)/""").find(url)?.groupValues?.getOrNull(1)
private suspend fun fixedIframe(url: String): String {
val id = Regex("""(?:/f/|/file/)(\w+)""").find(url)?.groupValues?.getOrNull(1)
return when {
url.startsWith(acefile) -> "$acefile/player/$id"
url.startsWith(linkbox) -> "https://www.linkbox.to/a/f/$id"
url.startsWith(lbx) -> {
val itemId = app.get("$linkbox/api/file/share_out_list/?sortField=utime&sortAsc=0&pageNo=1&pageSize=50&shareToken=$id&scene=singleItem&needTpInfo=1&lan=en").parsedSafe<Responses>()?.data?.itemId
"$linkbox/a/f/$itemId"
}
else -> url
}
}
@ -278,7 +283,8 @@ class OploverzProvider : MainAPI() {
)
data class Data(
@JsonProperty("rList") val rList: List<RList>?,
@JsonProperty("rList") val rList: List<RList>? = arrayListOf(),
@JsonProperty("itemId") val itemId: String? = null,
)
data class Responses(
@ -286,3 +292,8 @@ class OploverzProvider : MainAPI() {
)
}
class Streamhide : Filesim() {
override val mainUrl = "https://streamhide.to"
override val name = "Streamhide"
}

View file

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

View file

@ -1373,9 +1373,7 @@ object SoraExtractor : SoraStream() {
it.select("img").attr("src")
)
}.filter {
(it.quality.contains("1080p", true) || it.quality.contains(
"4k", true
)) && (it.type.contains("gdtot") || it.type.contains("oiya"))
it.quality.contains(Regex("(?i)(1080p|4k)")) && it.type.contains(Regex("(gdtot|oiya)"))
}
iframe.apmap { (link, quality, size, type) ->
val qualities = getFDoviesQuality(quality)
@ -2517,7 +2515,7 @@ object SoraExtractor : SoraStream() {
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
val query = getIndexQuery(title, year, season, episode)
val query = getIndexQuery(title, null, season, episode)
val files = app.get("$gdbot/search?q=$query").document.select("ul.divide-y li").map {
Triple(
it.select("a").attr("href"),

View file

@ -788,11 +788,11 @@ fun getIndexQuery(
episode: Int? = null
): String {
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
return if (season == null) {
"$title $year"
return (if (season == null) {
"$title ${year ?: ""}"
} else {
"$title S${seasonSlug}E${episodeSlug}"
}
}).trim()
}
fun searchIndex(