mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Change map to foreach and set the right referer
This commit is contained in:
parent
0b4985aac4
commit
c3eceba337
1 changed files with 17 additions and 17 deletions
|
@ -18,10 +18,10 @@ object SoraItalianExtractor : SoraItalianStream() {
|
||||||
"https://guardahd.stream/movie/$id",
|
"https://guardahd.stream/movie/$id",
|
||||||
referer = "/"
|
referer = "/"
|
||||||
).document
|
).document
|
||||||
res.select("ul._player-mirrors > li").map { source ->
|
res.select("ul._player-mirrors > li").forEach { source ->
|
||||||
loadExtractor(
|
loadExtractor(
|
||||||
fixUrl(source.attr("data-link")),
|
fixUrl(source.attr("data-link")),
|
||||||
"$/",
|
"https://guardahd.stream",
|
||||||
subtitleCallback,
|
subtitleCallback,
|
||||||
callback
|
callback
|
||||||
)
|
)
|
||||||
|
@ -44,13 +44,13 @@ object SoraItalianExtractor : SoraItalianStream() {
|
||||||
).document.selectFirst("h2>a")?.attr("href") ?: return
|
).document.selectFirst("h2>a")?.attr("href") ?: return
|
||||||
|
|
||||||
val document = app.get(url).document
|
val document = app.get(url).document
|
||||||
document.select("div.tab-content > div").mapIndexed { seasonData, data ->
|
document.select("div.tab-content > div").forEachIndexed { seasonData, data ->
|
||||||
data.select("li").mapIndexed { epNum, epData ->
|
data.select("li").forEachIndexed { epNum, epData ->
|
||||||
if (season == seasonData + 1 && episode == epNum + 1) {
|
if (season == seasonData + 1 && episode == epNum + 1) {
|
||||||
epData.select("div.mirrors > a.mr").map {
|
epData.select("div.mirrors > a.mr").forEach {
|
||||||
loadExtractor(
|
loadExtractor(
|
||||||
fixUrl(it.attr("data-link")),
|
fixUrl(it.attr("data-link")),
|
||||||
"$/",
|
guardaserieUrl,
|
||||||
subtitleCallback,
|
subtitleCallback,
|
||||||
callback
|
callback
|
||||||
)
|
)
|
||||||
|
@ -103,7 +103,7 @@ object SoraItalianExtractor : SoraItalianStream() {
|
||||||
}
|
}
|
||||||
|
|
||||||
episodeData?.select("#links > div > div > table > tbody:nth-child(2) > tr")
|
episodeData?.select("#links > div > div > table > tbody:nth-child(2) > tr")
|
||||||
?.map {
|
?.forEach {
|
||||||
val unshortenLink = unshorten(it.selectFirst("a")?.attr("href") ?: "")
|
val unshortenLink = unshorten(it.selectFirst("a")?.attr("href") ?: "")
|
||||||
loadExtractor(
|
loadExtractor(
|
||||||
unshortenLink,
|
unshortenLink,
|
||||||
|
@ -113,11 +113,11 @@ object SoraItalianExtractor : SoraItalianStream() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else { //movie
|
} else { //movie
|
||||||
doc.select("#info > ul > li").mapNotNull {
|
doc.select("#info > ul > li").forEach {
|
||||||
val unshortenLink = unshorten(it.selectFirst("a")?.attr("href") ?: "")
|
val unshortenLink = unshorten(it.selectFirst("a")?.attr("href") ?: "")
|
||||||
loadExtractor(
|
loadExtractor(
|
||||||
unshortenLink,
|
unshortenLink,
|
||||||
"$/",
|
filmpertuttiUrl,
|
||||||
subtitleCallback,
|
subtitleCallback,
|
||||||
callback
|
callback
|
||||||
)
|
)
|
||||||
|
@ -141,7 +141,7 @@ object SoraItalianExtractor : SoraItalianStream() {
|
||||||
|
|
||||||
links.apmap {
|
links.apmap {
|
||||||
val doc = app.get(it).document
|
val doc = app.get(it).document
|
||||||
doc.select("tr > td > a[href*='stayonline.pro']").mapNotNull {
|
doc.select("tr > td > a[href*='stayonline.pro']").forEach {
|
||||||
val link = it.selectFirst("a")?.attr("href") ?: ""
|
val link = it.selectFirst("a")?.attr("href") ?: ""
|
||||||
val apiPostId = link.substringAfter("/l/")
|
val apiPostId = link.substringAfter("/l/")
|
||||||
.substringBefore("/") //https://stayonline.pro/l/abcdef/ -> abcdef
|
.substringBefore("/") //https://stayonline.pro/l/abcdef/ -> abcdef
|
||||||
|
@ -149,20 +149,20 @@ object SoraItalianExtractor : SoraItalianStream() {
|
||||||
"https://stayonline.pro/ajax/linkView.php",
|
"https://stayonline.pro/ajax/linkView.php",
|
||||||
data = mapOf("id" to apiPostId)
|
data = mapOf("id" to apiPostId)
|
||||||
).text
|
).text
|
||||||
var url2 =
|
var bypassedUrl =
|
||||||
apiBodyBypass.substringAfter("\"value\": \"").substringBefore("\"")
|
apiBodyBypass.substringAfter("\"value\": \"").substringBefore("\"")
|
||||||
.replace("\\", "") //bypass stayonline link
|
.replace("\\", "") //bypass stayonline link
|
||||||
|
|
||||||
if (url2.contains("mixdrop.club")) //https://mixdrop.club/f/lllllllll/2/abcdefghilmn.mp4 (fake mp4 url) -> https://mixdrop.ch/e/lllllllll
|
if (bypassedUrl.contains("mixdrop.club")) //https://mixdrop.club/f/lllllllll/2/abcdefghilmn.mp4 (fake mp4 url) -> https://mixdrop.ch/e/lllllllll
|
||||||
url2 = url2.replace("mixdrop.club", "mixdrop.ch")
|
bypassedUrl = bypassedUrl.replace("mixdrop.club", "mixdrop.ch")
|
||||||
.substringBeforeLast("/")
|
.substringBeforeLast("/")
|
||||||
.substringBeforeLast("/")
|
.substringBeforeLast("/")
|
||||||
.replace("/f/", "/e/")
|
.replace("/f/", "/e/")
|
||||||
else
|
else
|
||||||
url2 = unshorten(url2)
|
bypassedUrl = unshorten(bypassedUrl)
|
||||||
loadExtractor(
|
loadExtractor(
|
||||||
url2,
|
bypassedUrl,
|
||||||
"$/",
|
cb01Url,
|
||||||
subtitleCallback,
|
subtitleCallback,
|
||||||
callback
|
callback
|
||||||
)
|
)
|
||||||
|
@ -189,7 +189,7 @@ object SoraItalianExtractor : SoraItalianStream() {
|
||||||
val servers = document.select(".widget.servers")
|
val servers = document.select(".widget.servers")
|
||||||
servers.select(".server[data-name=\"9\"] .episode > a").toList()
|
servers.select(".server[data-name=\"9\"] .episode > a").toList()
|
||||||
.filter { it.attr("data-episode-num").toIntOrNull()?.equals(episode) ?: false }
|
.filter { it.attr("data-episode-num").toIntOrNull()?.equals(episode) ?: false }
|
||||||
.map { id ->
|
.forEach { id ->
|
||||||
val url = tryParseJson<AnimeWorldJson>(
|
val url = tryParseJson<AnimeWorldJson>(
|
||||||
app.get("$animeworldUrl/api/episode/info?id=${id.attr("data-id")}").text
|
app.get("$animeworldUrl/api/episode/info?id=${id.attr("data-id")}").text
|
||||||
)?.grabber
|
)?.grabber
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue