diff --git a/EneyidaProvider/build.gradle.kts b/EneyidaProvider/build.gradle.kts index 393bd5b..e035194 100644 --- a/EneyidaProvider/build.gradle.kts +++ b/EneyidaProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 8 +version = 9 dependencies { testImplementation(libs.junit) diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt index bb5fc3a..883c1c3 100644 --- a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt +++ b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt @@ -1,6 +1,5 @@ package com.lagradost -import android.util.Log import com.lagradost.models.PlayerJson import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addActors @@ -17,6 +16,7 @@ class EneyidaProvider : MainAPI() { override var name = "Eneyida" override val hasMainPage = true override var lang = "uk" + override val hasQuickSearch = true override val hasDownloadSupport = true override val supportedTypes = setOf( TvType.Movie, @@ -56,6 +56,8 @@ class EneyidaProvider : MainAPI() { } + override suspend fun quickSearch(query: String): List = search(query) + override suspend fun search(query: String): List { val document = app.post( url = mainUrl, @@ -83,7 +85,7 @@ class EneyidaProvider : MainAPI() { val year = fullInfo[0].select("a").text().toIntOrNull() val playerUrl = document.select(".tabs_b.visible iframe").attr("src") - val tvType = if (tags.contains("фільм") or playerUrl.contains("/vod/")) TvType.Movie else TvType.TvSeries + val tvType = if (tags.contains("фільм") or tags.contains("мультьфільм") or playerUrl.contains("/vod/")) TvType.Movie else TvType.TvSeries val description = document.selectFirst(".full_content-desc p")?.text()?.trim() val trailer = document.selectFirst("div#trailer_place iframe")?.attr("src").toString() val rating = document.selectFirst(".r_kp span, .r_imdb span")?.text().toRatingInt() @@ -101,16 +103,16 @@ class EneyidaProvider : MainAPI() { .substringAfterLast("file: \'") .substringBefore("\',") - tryParseJson>(playerRawJson)?.map { dubs -> // Dubs - for(season in dubs.folder){ // Seasons - for(episode in season.folder){ // Episodes + tryParseJson>(playerRawJson)?.map { season -> // Dubs + for (episode in season.folder) { // Seasons + for (dubs in episode.folder) { // Episodes episodes.add( Episode( "${season.title}, ${episode.title}, $playerUrl", episode.title, - season.title.replace(" Сезон ","").toIntOrNull(), - episode.title.replace("Серія ","").toIntOrNull(), - episode.poster + season.title.replace(" сезон","").toIntOrNull(), + episode.title.replace(" серія","").toIntOrNull(), + dubs.poster ) ) } @@ -118,7 +120,7 @@ class EneyidaProvider : MainAPI() { } newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) { this.posterUrl = poster - this.backgroundPosterUrl = banner + this.backgroundPosterUrl = "$mainUrl$banner" this.year = year this.plot = description this.tags = tags @@ -130,7 +132,7 @@ class EneyidaProvider : MainAPI() { } else { // Parse as Movie. newMovieLoadResponse(title, url, TvType.Movie, "$title, $playerUrl") { this.posterUrl = poster - this.backgroundPosterUrl = banner + this.backgroundPosterUrl = "$mainUrl$banner" this.year = year this.plot = description this.tags = tags @@ -180,28 +182,26 @@ class EneyidaProvider : MainAPI() { .substringAfterLast("file: \'") .substringBefore("\',") - tryParseJson>(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 - M3u8Helper.generateM3u8( - source = dubs.title, - streamUrl = episode.file.replace("https://", "http://"), - referer = "https://tortuga.wtf/" - ).last().let(callback) + tryParseJson>(playerRawJson)?.map { season -> + if(season.title != dataList[0]) return@map - if(episode.subtitle.isBlank()) return@map - episode.subtitle.split(",").forEach{ - subtitleCallback.invoke( - SubtitleFile( - it.substringAfterLast("[").substringBefore("]"), - it.substringAfter("]") - ) - ) - } - } + for (episode in season.folder) { + if(episode.title != dataList[1]) return@map + + for (dubs in episode.folder) { + M3u8Helper.generateM3u8( + 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("]") + ) + ) } } } diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt index 163dd77..b07c619 100644 --- a/EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt +++ b/EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt @@ -3,12 +3,14 @@ package com.lagradost.models data class PlayerJson ( val title : String, + val season : Int, val folder : List ) data class Season ( val title : String, + val number: Int, val folder : List ) diff --git a/KinoVezhaProvider/build.gradle.kts b/KinoVezhaProvider/build.gradle.kts index 809358c..9da7293 100644 --- a/KinoVezhaProvider/build.gradle.kts +++ b/KinoVezhaProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 5 +version = 6 dependencies { testImplementation(libs.junit) diff --git a/KinoVezhaProvider/src/main/kotlin/com/lagradost/KinoVezhaProvider.kt b/KinoVezhaProvider/src/main/kotlin/com/lagradost/KinoVezhaProvider.kt index 4254baf..3d76a37 100644 --- a/KinoVezhaProvider/src/main/kotlin/com/lagradost/KinoVezhaProvider.kt +++ b/KinoVezhaProvider/src/main/kotlin/com/lagradost/KinoVezhaProvider.kt @@ -14,6 +14,7 @@ class KinoVezhaProvider : MainAPI() { override var name = "KinoVezha" override val hasMainPage = true override var lang = "uk" + override val hasQuickSearch = true override val hasDownloadSupport = true override val supportedTypes = setOf( TvType.Movie, @@ -53,6 +54,8 @@ class KinoVezhaProvider : MainAPI() { } + override suspend fun quickSearch(query: String): List = search(query) + override suspend fun search(query: String): List { val document = app.post( url = "$mainUrl/index.php?do=search", @@ -95,16 +98,16 @@ class KinoVezhaProvider : MainAPI() { .substringAfterLast("file: \'") .substringBefore("\',") - AppUtils.tryParseJson>(playerRawJson)?.map { dubs -> // Dubs - for(season in dubs.folder){ // Seasons - for(episode in season.folder){ // Episodes + AppUtils.tryParseJson>(playerRawJson)?.map { season -> // Dubs + for (episode in season.folder) { // Seasons + for (dubs in episode.folder) { // Episodes episodes.add( Episode( "${season.title}, ${episode.title}, $playerUrl", episode.title, - season.title.replace(" Сезон ","").toIntOrNull(), - episode.title.replace("Серія ","").toIntOrNull(), - episode.poster + season.season, + episode.number, + dubs.poster ) ) } @@ -156,18 +159,26 @@ class KinoVezhaProvider : MainAPI() { .substringAfterLast("file: \'") .substringBefore("\',") - AppUtils.tryParseJson>(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 - M3u8Helper.generateM3u8( - source = dubs.title, - streamUrl = episode.file, - referer = "https://tortuga.wtf/" - ).last().let(callback) - } + AppUtils.tryParseJson>(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) { + M3u8Helper.generateM3u8( + 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("]") + ) + ) } } } diff --git a/KinoVezhaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt b/KinoVezhaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt index 163dd77..b07c619 100644 --- a/KinoVezhaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt +++ b/KinoVezhaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt @@ -3,12 +3,14 @@ package com.lagradost.models data class PlayerJson ( val title : String, + val season : Int, val folder : List ) data class Season ( val title : String, + val number: Int, val folder : List ) diff --git a/KlonTVProvider/build.gradle.kts b/KlonTVProvider/build.gradle.kts index 8b13362..125b428 100644 --- a/KlonTVProvider/build.gradle.kts +++ b/KlonTVProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 6 +version = 7 dependencies { testImplementation(libs.junit) diff --git a/KlonTVProvider/src/main/kotlin/com/lagradost/models/GeneralInfo.kt b/KlonTVProvider/src/main/kotlin/com/lagradost/models/GeneralInfo.kt index 21cdaa1..fb02ed4 100644 --- a/KlonTVProvider/src/main/kotlin/com/lagradost/models/GeneralInfo.kt +++ b/KlonTVProvider/src/main/kotlin/com/lagradost/models/GeneralInfo.kt @@ -10,7 +10,7 @@ data class GeneralInfo ( val isFamilyFriendly : Boolean, val timeRequired : Int, val datePublished : String, - val director : List, + val director : List?, val actor : List, val countryOfOrigin : List, val aggregateRating : AggregateRating?, diff --git a/SerialnoProvider/build.gradle.kts b/SerialnoProvider/build.gradle.kts index b6fa114..7b528ad 100644 --- a/SerialnoProvider/build.gradle.kts +++ b/SerialnoProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 6 +version = 7 dependencies { testImplementation(libs.junit) diff --git a/SerialnoProvider/src/main/kotlin/com/lagradost/SerialnoProvider.kt b/SerialnoProvider/src/main/kotlin/com/lagradost/SerialnoProvider.kt index 83996d4..4a55791 100644 --- a/SerialnoProvider/src/main/kotlin/com/lagradost/SerialnoProvider.kt +++ b/SerialnoProvider/src/main/kotlin/com/lagradost/SerialnoProvider.kt @@ -27,6 +27,7 @@ class SerialnoProvider : MainAPI() { override var name = "Serialno" override val hasMainPage = true override var lang = "uk" + override val hasQuickSearch = true override val hasDownloadSupport = true override val supportedTypes = setOf( TvType.Movie, @@ -66,6 +67,8 @@ class SerialnoProvider : MainAPI() { } + override suspend fun quickSearch(query: String): List = search(query) + override suspend fun search(query: String): List { val document = app.post( url = "$mainUrl/", @@ -115,16 +118,16 @@ class SerialnoProvider : MainAPI() { .substringAfterLast("file: \'") .substringBefore("\',") - AppUtils.tryParseJson>(playerRawJson)?.map { dubs -> // Dubs - for (season in dubs.folder) { // Seasons - for (episode in season.folder) { // Episodes + AppUtils.tryParseJson>(playerRawJson)?.map { season -> // Dubs + for (episode in season.folder) { // Seasons + for (dubs in episode.folder) { // Episodes episodes.add( Episode( "${season.title}, ${episode.title}, $playerUrl", episode.title, - season.title.replace(" Сезон ", "").toIntOrNull(), - episode.title.replace("Серія ", "").toIntOrNull(), - episode.poster + season.season, + episode.number, + dubs.poster ) ) } @@ -153,26 +156,26 @@ class SerialnoProvider : MainAPI() { .substringAfterLast("file: \'") .substringBefore("\',") - AppUtils.tryParseJson>(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 - M3u8Helper.generateM3u8( - source = dubs.title, - streamUrl = episode.file, - referer = "https://tortuga.wtf/" - ).last().let(callback) + AppUtils.tryParseJson>(playerRawJson)?.map { season -> + if(season.title != dataList[0]) return@map - if(episode.subtitle.isNullOrBlank()) return true - subtitleCallback.invoke( - SubtitleFile( - episode.subtitle.substringAfterLast("[").substringBefore("]"), - episode.subtitle.substringAfter("]") - ) + for (episode in season.folder) { + if(episode.title != dataList[1]) return@map + + for (dubs in episode.folder) { + M3u8Helper.generateM3u8( + 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("]") ) - } + ) } } } diff --git a/SerialnoProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt b/SerialnoProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt index 163dd77..b07c619 100644 --- a/SerialnoProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt +++ b/SerialnoProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt @@ -3,12 +3,14 @@ package com.lagradost.models data class PlayerJson ( val title : String, + val season : Int, val folder : List ) data class Season ( val title : String, + val number: Int, val folder : List ) diff --git a/SerialnoProvider/src/test/kotlin/com/lagradost/SerialnoProviderTest.kt b/SerialnoProvider/src/test/kotlin/com/lagradost/SerialnoProviderTest.kt index df04baa..963b2df 100644 --- a/SerialnoProvider/src/test/kotlin/com/lagradost/SerialnoProviderTest.kt +++ b/SerialnoProvider/src/test/kotlin/com/lagradost/SerialnoProviderTest.kt @@ -1,5 +1,6 @@ package com.lagradost +import com.lagradost.cloudstream3.utils.AppUtils.toJson import com.lagradost.cloudstreamtest.ProviderTester import kotlinx.coroutines.test.runTest import org.junit.Test