exts: Hotfix return@map

This commit is contained in:
CakesTwix 2025-03-07 11:24:06 +02:00
parent 4038dbd50c
commit 66e2d08736
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
8 changed files with 77 additions and 86 deletions
EneyidaProvider
build.gradle.kts
src/main/kotlin/com/lagradost
KinoVezhaProvider
build.gradle.kts
src/main/kotlin/com/lagradost
KlonTVProvider
build.gradle.kts
src/main/kotlin/com/lagradost
SerialnoProvider
build.gradle.kts
src/main/kotlin/com/lagradost

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 9 version = 10
dependencies { dependencies {
testImplementation(libs.junit) testImplementation(libs.junit)

View file

@ -4,6 +4,7 @@ import com.lagradost.models.PlayerJson
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.utils.AppUtils
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
import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.cloudstream3.utils.M3u8Helper
@ -182,30 +183,27 @@ class EneyidaProvider : MainAPI() {
.substringAfterLast("file: \'") .substringAfterLast("file: \'")
.substringBefore("\',") .substringBefore("\',")
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season -> tryParseJson<List<PlayerJson>>(playerRawJson)
if(season.title != dataList[0]) return@map ?.filter { it.title == dataList[0] } // Фільтруємо потрібний сезон
?.flatMap { it.folder } // Беремо список епізодів
?.filter { it.title == dataList[1] } // Фільтруємо потрібний епізод
?.flatMap { it.folder } // Беремо список дубляжів
?.forEach { dubs -> // Обробляємо кожен дубляж
M3u8Helper.generateM3u8(
source = dubs.title,
streamUrl = dubs.file,
referer = "https://tortuga.wtf/"
).last().let(callback)
for (episode in season.folder) { if (!dubs.subtitle.isNullOrBlank()) {
if(episode.title != dataList[1]) return@map subtitleCallback.invoke(
SubtitleFile(
for (dubs in episode.folder) { dubs.subtitle.substringAfterLast("[").substringBefore("]"),
M3u8Helper.generateM3u8( dubs.subtitle.substringAfter("]")
source = dubs.title,
streamUrl = dubs.file,
referer = "https://tortuga.wtf/"
).last().let(callback)
if(dubs.subtitle.isNullOrBlank()) {
subtitleCallback.invoke(
SubtitleFile(
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
dubs.subtitle.substringAfter("]")
)
) )
} )
} }
} }
}
return true return true
} }

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 6 version = 7
dependencies { dependencies {
testImplementation(libs.junit) testImplementation(libs.junit)

View file

@ -159,30 +159,27 @@ class KinoVezhaProvider : MainAPI() {
.substringAfterLast("file: \'") .substringAfterLast("file: \'")
.substringBefore("\',") .substringBefore("\',")
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season -> AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)
if(season.title != dataList[0]) return@map ?.filter { it.title == dataList[0] } // Фільтруємо потрібний сезон
?.flatMap { it.folder } // Беремо список епізодів
?.filter { it.title == dataList[1] } // Фільтруємо потрібний епізод
?.flatMap { it.folder } // Беремо список дубляжів
?.forEach { dubs -> // Обробляємо кожен дубляж
M3u8Helper.generateM3u8(
source = dubs.title,
streamUrl = dubs.file,
referer = "https://tortuga.wtf/"
).last().let(callback)
for (episode in season.folder) { if (!dubs.subtitle.isNullOrBlank()) {
if(episode.title != dataList[1]) return@map subtitleCallback.invoke(
SubtitleFile(
for (dubs in episode.folder) { dubs.subtitle.substringAfterLast("[").substringBefore("]"),
M3u8Helper.generateM3u8( dubs.subtitle.substringAfter("]")
source = dubs.title,
streamUrl = dubs.file,
referer = "https://tortuga.wtf/"
).last().let(callback)
if(dubs.subtitle.isNullOrBlank()) {
subtitleCallback.invoke(
SubtitleFile(
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
dubs.subtitle.substringAfter("]")
)
) )
} )
} }
} }
}
return true return true
} }
} }

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 8 version = 9
dependencies { dependencies {
testImplementation(libs.junit) testImplementation(libs.junit)

View file

@ -3,6 +3,7 @@ package com.lagradost
import com.lagradost.models.PlayerJson import com.lagradost.models.PlayerJson
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.utils.AppUtils
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
import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.cloudstream3.utils.M3u8Helper
@ -211,30 +212,27 @@ class KlonTVProvider : MainAPI() {
.substringAfterLast("file:\'") .substringAfterLast("file:\'")
.substringBefore("\',") .substringBefore("\',")
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs tryParseJson<List<PlayerJson>>(playerRawJson)
for(season in dubs.folder){ // Seasons ?.filter { it.title == dataList[0] } // Фільтруємо потрібний сезон
if(season.title == dataList[0]){ ?.flatMap { it.folder } // Беремо список епізодів
for(episode in season.folder){ // Episodes ?.filter { it.title == dataList[1] } // Фільтруємо потрібний епізод
if(episode.title == dataList[1]){ ?.flatMap { it.folder } // Беремо список дубляжів
// Add as source ?.forEach { dubs -> // Обробляємо кожен дубляж
M3u8Helper.generateM3u8( M3u8Helper.generateM3u8(
source = dubs.title, source = dubs.title,
streamUrl = episode.file, streamUrl = dubs.file,
referer = "https://tortuga.wtf/" referer = "https://tortuga.wtf/"
).last().let(callback) ).last().let(callback)
if(episode.subtitle.isBlank()) return true if (!dubs.subtitle.isNullOrBlank()) {
subtitleCallback.invoke( subtitleCallback.invoke(
SubtitleFile( SubtitleFile(
episode.subtitle.substringAfterLast("[").substringBefore("]"), dubs.subtitle.substringAfterLast("[").substringBefore("]"),
episode.subtitle.substringAfter("]") dubs.subtitle.substringAfter("]")
) )
) )
}
}
} }
} }
}
return true return true
} }

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 7 version = 8
dependencies { dependencies {
testImplementation(libs.junit) testImplementation(libs.junit)

View file

@ -1,5 +1,6 @@
package com.lagradost package com.lagradost
import android.util.Log
import com.lagradost.cloudstream3.Episode import com.lagradost.cloudstream3.Episode
import com.lagradost.cloudstream3.HomePageResponse import com.lagradost.cloudstream3.HomePageResponse
import com.lagradost.cloudstream3.LoadResponse import com.lagradost.cloudstream3.LoadResponse
@ -151,35 +152,32 @@ class SerialnoProvider : MainAPI() {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
val dataList = data.split(", ") val dataList = data.split(", ")
Log.d("CakesTwix-Debug", data)
val playerRawJson = app.get(dataList[2]).document.select("script").html() val playerRawJson = app.get(dataList[2]).document.select("script").html()
.substringAfterLast("file: \'") .substringAfterLast("file: \'")
.substringBefore("\',") .substringBefore("\',")
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season -> AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)
if(season.title != dataList[0]) return@map ?.filter { it.title == dataList[0] } // Фільтруємо потрібний сезон
?.flatMap { it.folder } // Беремо список епізодів
?.filter { it.title == dataList[1] } // Фільтруємо потрібний епізод
?.flatMap { it.folder } // Беремо список дубляжів
?.forEach { dubs -> // Обробляємо кожен дубляж
M3u8Helper.generateM3u8(
source = dubs.title,
streamUrl = dubs.file,
referer = "https://tortuga.wtf/"
).last().let(callback)
for (episode in season.folder) { if (!dubs.subtitle.isNullOrBlank()) {
if(episode.title != dataList[1]) return@map subtitleCallback.invoke(
SubtitleFile(
for (dubs in episode.folder) { dubs.subtitle.substringAfterLast("[").substringBefore("]"),
M3u8Helper.generateM3u8( dubs.subtitle.substringAfter("]")
source = dubs.title,
streamUrl = dubs.file,
referer = "https://tortuga.wtf/"
).last().let(callback)
if(dubs.subtitle.isNullOrBlank()) {
subtitleCallback.invoke(
SubtitleFile(
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
dubs.subtitle.substringAfter("]")
)
) )
} )
} }
} }
}
return true return true
} }
} }