exts: Hotfix return@map
All checks were successful
Build / build (push) Successful in 1m8s

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

View file

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

View file

@ -4,6 +4,7 @@ import com.lagradost.models.PlayerJson
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
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.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper
@ -182,20 +183,19 @@ class EneyidaProvider : MainAPI() {
.substringAfterLast("file: \'")
.substringBefore("\',")
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season ->
if(season.title != dataList[0]) return@map
for (episode in season.folder) {
if(episode.title != dataList[1]) return@map
for (dubs in episode.folder) {
tryParseJson<List<PlayerJson>>(playerRawJson)
?.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)
if(dubs.subtitle.isNullOrBlank()) {
if (!dubs.subtitle.isNullOrBlank()) {
subtitleCallback.invoke(
SubtitleFile(
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
@ -204,8 +204,6 @@ class EneyidaProvider : MainAPI() {
)
}
}
}
}
return true
}

View file

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

View file

@ -159,20 +159,19 @@ class KinoVezhaProvider : MainAPI() {
.substringAfterLast("file: \'")
.substringBefore("\',")
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season ->
if(season.title != dataList[0]) return@map
for (episode in season.folder) {
if(episode.title != dataList[1]) return@map
for (dubs in episode.folder) {
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)
?.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)
if(dubs.subtitle.isNullOrBlank()) {
if (!dubs.subtitle.isNullOrBlank()) {
subtitleCallback.invoke(
SubtitleFile(
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
@ -181,8 +180,6 @@ class KinoVezhaProvider : MainAPI() {
)
}
}
}
}
return true
}
}

View file

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

View file

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

View file

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

View file

@ -1,5 +1,6 @@
package com.lagradost
import android.util.Log
import com.lagradost.cloudstream3.Episode
import com.lagradost.cloudstream3.HomePageResponse
import com.lagradost.cloudstream3.LoadResponse
@ -151,25 +152,24 @@ class SerialnoProvider : MainAPI() {
callback: (ExtractorLink) -> Unit
): Boolean {
val dataList = data.split(", ")
Log.d("CakesTwix-Debug", data)
val playerRawJson = app.get(dataList[2]).document.select("script").html()
.substringAfterLast("file: \'")
.substringBefore("\',")
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season ->
if(season.title != dataList[0]) return@map
for (episode in season.folder) {
if(episode.title != dataList[1]) return@map
for (dubs in episode.folder) {
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)
?.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)
if(dubs.subtitle.isNullOrBlank()) {
if (!dubs.subtitle.isNullOrBlank()) {
subtitleCallback.invoke(
SubtitleFile(
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
@ -178,8 +178,6 @@ class SerialnoProvider : MainAPI() {
)
}
}
}
}
return true
}
}