mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed HDrezka
This commit is contained in:
parent
f3b06e2a3b
commit
9d439f417d
4 changed files with 59 additions and 64 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||||
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
|
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||||
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.ExtractorLink
|
||||||
|
@ -91,7 +90,7 @@ class HDrezkaProvider : MainAPI() {
|
||||||
?: document.selectFirst("div.b-post__title h1")?.text()?.trim()).toString()
|
?: document.selectFirst("div.b-post__title h1")?.text()?.trim()).toString()
|
||||||
val poster = fixUrlNull(document.selectFirst("div.b-sidecover img")?.attr("src"))
|
val poster = fixUrlNull(document.selectFirst("div.b-sidecover img")?.attr("src"))
|
||||||
val tags =
|
val tags =
|
||||||
document.select("table.b-post__info > tbody > tr:nth-child(5) span[itemprop=genre]")
|
document.select("table.b-post__info > tbody > tr:contains(Жанр) span[itemprop=genre]")
|
||||||
.map { it.text() }
|
.map { it.text() }
|
||||||
val year = document.select("div.film-info > div:nth-child(2) a").text().toIntOrNull()
|
val year = document.select("div.film-info > div:nth-child(2) a").text().toIntOrNull()
|
||||||
val tvType = if (document.select("div#simple-episodes-tabs")
|
val tvType = if (document.select("div#simple-episodes-tabs")
|
||||||
|
@ -108,9 +107,10 @@ class HDrezkaProvider : MainAPI() {
|
||||||
val rating =
|
val rating =
|
||||||
document.selectFirst("table.b-post__info > tbody > tr:nth-child(1) span.bold")?.text()
|
document.selectFirst("table.b-post__info > tbody > tr:nth-child(1) span.bold")?.text()
|
||||||
.toRatingInt()
|
.toRatingInt()
|
||||||
val actors = document.select("table.b-post__info > tbody > tr:last-child span.item").map {
|
val actors =
|
||||||
|
document.select("table.b-post__info > tbody > tr:last-child span.item").mapNotNull {
|
||||||
Actor(
|
Actor(
|
||||||
it.selectFirst("span[itemprop=name]")?.text().toString(),
|
it.selectFirst("span[itemprop=name]")?.text() ?: return@mapNotNull null,
|
||||||
it.selectFirst("span[itemprop=actor]")?.attr("data-photo")
|
it.selectFirst("span[itemprop=actor]")?.attr("data-photo")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -273,35 +273,25 @@ class HDrezkaProvider : MainAPI() {
|
||||||
) {
|
) {
|
||||||
decryptStreamUrl(url).split(",").map { links ->
|
decryptStreamUrl(url).split(",").map { links ->
|
||||||
val quality =
|
val quality =
|
||||||
Regex("\\[([0-9]*p.*?)]").find(links)?.groupValues?.getOrNull(1)
|
Regex("\\[([0-9]{3,4}p\\s?\\w*?)]").find(links)?.groupValues?.getOrNull(1)
|
||||||
.toString().trim()
|
?.trim() ?: return@map null
|
||||||
links.replace("[$quality]", "").split("or").map { it.trim() }
|
links.replace("[$quality]", "").split(" or ")
|
||||||
.map { link ->
|
.map {
|
||||||
|
val link = it.trim()
|
||||||
if (link.endsWith(".m3u8")) {
|
val type = if(link.contains(".m3u8")) "(Main)" else "(Backup)"
|
||||||
cleanCallback(
|
cleanCallback(
|
||||||
"$source (Main)",
|
"$source $type",
|
||||||
link,
|
link,
|
||||||
quality,
|
quality,
|
||||||
true,
|
link.contains(".m3u8"),
|
||||||
sourceCallback,
|
sourceCallback,
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
cleanCallback(
|
|
||||||
"$source (Backup)",
|
|
||||||
link,
|
|
||||||
quality,
|
|
||||||
false,
|
|
||||||
sourceCallback,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subtitle.split(",").map { sub ->
|
subtitle.split(",").map { sub ->
|
||||||
val language =
|
val language =
|
||||||
Regex("\\[(.*)]").find(sub)?.groupValues?.getOrNull(1)
|
Regex("\\[(.*)]").find(sub)?.groupValues?.getOrNull(1) ?: return@map null
|
||||||
.toString()
|
|
||||||
val link = sub.replace("[$language]", "").trim()
|
val link = sub.replace("[$language]", "").trim()
|
||||||
subCallback.invoke(
|
subCallback.invoke(
|
||||||
SubtitleFile(
|
SubtitleFile(
|
||||||
|
@ -339,7 +329,6 @@ class HDrezkaProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res.server?.apmap { server ->
|
res.server?.apmap { server ->
|
||||||
suspendSafeApiCall {
|
|
||||||
app.post(
|
app.post(
|
||||||
url = "$mainUrl/ajax/get_cdn_series/?t=${Date().time}",
|
url = "$mainUrl/ajax/get_cdn_series/?t=${Date().time}",
|
||||||
data = mapOf(
|
data = mapOf(
|
||||||
|
@ -366,7 +355,6 @@ class HDrezkaProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,21 +166,21 @@ object SoraExtractor : SoraStream() {
|
||||||
app.get("https://voidboost.net/serial/$token/iframe?s=$season&e=$episode&h=dbgo.fun").document.select(
|
app.get("https://voidboost.net/serial/$token/iframe?s=$season&e=$episode&h=dbgo.fun").document.select(
|
||||||
"script"
|
"script"
|
||||||
).find { it.data().contains("CDNplayerConfig =") }?.data()
|
).find { it.data().contains("CDNplayerConfig =") }?.data()
|
||||||
}
|
} ?: return
|
||||||
|
|
||||||
val source =
|
val source =
|
||||||
Regex("['|\"]file['|\"]:\\s['|\"](#\\S+?)['|\"]").find(script.toString())?.groupValues?.get(
|
Regex("['|\"]file['|\"]:\\s['|\"](#\\S+?)['|\"]").find(script)?.groupValues?.get(
|
||||||
1
|
1
|
||||||
) ?: return
|
) ?: return
|
||||||
val subtitle =
|
val subtitle =
|
||||||
Regex("['|\"]subtitle['|\"]:\\s['|\"](\\S+?)['|\"]").find(script.toString())?.groupValues?.get(
|
Regex("['|\"]subtitle['|\"]:\\s['|\"](\\S+?)['|\"]").find(script)?.groupValues?.get(
|
||||||
1
|
1
|
||||||
)
|
)
|
||||||
|
|
||||||
val ref = getBaseUrl(iframeDbgo)
|
val ref = getBaseUrl(iframeDbgo)
|
||||||
decryptStreamUrl(source).split(",").map { links ->
|
decryptStreamUrl(source).split(",").map { links ->
|
||||||
val quality =
|
val quality =
|
||||||
Regex("\\[([0-9]*p.*?)]").find(links)?.groupValues?.getOrNull(1).toString().trim()
|
Regex("\\[([0-9]*p.*?)]").find(links)?.groupValues?.getOrNull(1)?.trim() ?: return@map null
|
||||||
links.replace("[$quality]", "").split(" or ").map { it.trim() }.map { link ->
|
links.replace("[$quality]", "").split(" or ").map { it.trim() }.map { link ->
|
||||||
val name = if (link.contains(".m3u8")) "Dbgo (Main)" else "Dbgo (Backup)"
|
val name = if (link.contains(".m3u8")) "Dbgo (Main)" else "Dbgo (Backup)"
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
|
@ -200,11 +200,11 @@ object SoraExtractor : SoraStream() {
|
||||||
}
|
}
|
||||||
|
|
||||||
subtitle?.split(",")?.map { sub ->
|
subtitle?.split(",")?.map { sub ->
|
||||||
val language = Regex("\\[(.*)]").find(sub)?.groupValues?.getOrNull(1).toString()
|
val language = Regex("\\[(.*)]").find(sub)?.groupValues?.getOrNull(1) ?: return@map null
|
||||||
val link = sub.replace("[$language]", "").trim()
|
val link = sub.replace("[$language]", "").trim()
|
||||||
subtitleCallback.invoke(
|
subtitleCallback.invoke(
|
||||||
SubtitleFile(
|
SubtitleFile(
|
||||||
language, link
|
getDbgoLanguage(language), link
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.hexated.SoraStream.Companion.filmxyAPI
|
||||||
import com.hexated.SoraStream.Companion.gdbot
|
import com.hexated.SoraStream.Companion.gdbot
|
||||||
import com.hexated.SoraStream.Companion.kamyrollAPI
|
import com.hexated.SoraStream.Companion.kamyrollAPI
|
||||||
import com.hexated.SoraStream.Companion.tvMoviesAPI
|
import com.hexated.SoraStream.Companion.tvMoviesAPI
|
||||||
import com.lagradost.cloudstream3.APIHolder
|
|
||||||
import com.lagradost.cloudstream3.APIHolder.getCaptchaToken
|
import com.lagradost.cloudstream3.APIHolder.getCaptchaToken
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.base64Decode
|
import com.lagradost.cloudstream3.base64Decode
|
||||||
|
@ -603,6 +602,14 @@ fun getVipLanguage(str: String): String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getDbgoLanguage(str: String): String {
|
||||||
|
return when (str) {
|
||||||
|
"Русский" -> "Russian"
|
||||||
|
"Українська" -> "Ukrainian"
|
||||||
|
else -> str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getBaseUrl(url: String): String {
|
fun getBaseUrl(url: String): String {
|
||||||
return URI(url).let {
|
return URI(url).let {
|
||||||
"${it.scheme}://${it.host}"
|
"${it.scheme}://${it.host}"
|
||||||
|
|
Loading…
Reference in a new issue