From 9e714ded0c417c6a604d357827a95458ab14a26d Mon Sep 17 00:00:00 2001 From: CakesTwix Date: Fri, 17 Feb 2023 17:35:24 +0200 Subject: [PATCH 1/5] eneyida: Parsing home page --- EneyidaProvider/build.gradle.kts | 27 ++ EneyidaProvider/src/main/AndroidManifest.xml | 2 + .../kotlin/com/lagradost/EneyidaProvider.kt | 260 ++++++++++++++++++ .../com/lagradost/EneyidaProviderPlugin.kt | 13 + 4 files changed, 302 insertions(+) create mode 100644 EneyidaProvider/build.gradle.kts create mode 100644 EneyidaProvider/src/main/AndroidManifest.xml create mode 100644 EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt create mode 100644 EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProviderPlugin.kt diff --git a/EneyidaProvider/build.gradle.kts b/EneyidaProvider/build.gradle.kts new file mode 100644 index 0000000..3c2f1d2 --- /dev/null +++ b/EneyidaProvider/build.gradle.kts @@ -0,0 +1,27 @@ +// use an integer for version numbers +version = 2 + + +cloudstream { + language = "uk" + // All of these properties are optional, you can safely remove them + + description = "Дивитися фільми та серіали онлайн в HD якості. У нас можна дивитися кіно онлайн безкоштовно, у високій якості та з якісним українським дубляжем." + authors = listOf("CakesTwix") + + /** + * Status int as the following: + * 0: Down + * 1: Ok + * 2: Slow + * 3: Beta only + * */ + status = 1 // will be 3 if unspecified + tvTypes = listOf( + "Anime", + "TvSeries", + "Movie", + ) + + iconUrl = "https://www.google.com/s2/favicons?domain=uakino.club&sz=%size%" +} \ No newline at end of file diff --git a/EneyidaProvider/src/main/AndroidManifest.xml b/EneyidaProvider/src/main/AndroidManifest.xml new file mode 100644 index 0000000..29aec9d --- /dev/null +++ b/EneyidaProvider/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt new file mode 100644 index 0000000..318beea --- /dev/null +++ b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt @@ -0,0 +1,260 @@ +package com.lagradost + +import android.util.Log +import com.lagradost.cloudstream3.* +import com.lagradost.cloudstream3.LoadResponse.Companion.addActors +import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.M3u8Helper +import org.jsoup.Jsoup +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import java.util.* + +class EneyidaProvider : MainAPI() { + + // Basic Info + override var mainUrl = "https://eneyida.tv" + override var name = "Eneyida" + override val hasMainPage = true + override var lang = "uk" + override val hasDownloadSupport = true + override val supportedTypes = setOf( + TvType.Movie, + TvType.TvSeries, + TvType.Anime, + ) + + // Sections + override val mainPage = mainPageOf( + "$mainUrl/films/page/" to "Фільми", + "$mainUrl/series/page/" to "Серіали", + "$mainUrl/anime/page/" to "Аніме", + "$mainUrl/cartoon/page/" to "Мультфільми", + "$mainUrl/cartoon-series/page/" to "Мультсеріали", + ) + + override suspend fun getMainPage( + page: Int, + request: MainPageRequest + ): HomePageResponse { + var document = app.get(request.data + page).document + + val home = document.select("article.short").map { + it.toSearchResponse() + } + return newHomePageResponse(request.name, home) + } + + private fun Element.toSearchResponse(): SearchResponse { + val title = this.selectFirst("a.short_title")?.text()?.trim().toString() + val href = this.selectFirst("div.short_title")?.attr("href").toString() + val posterUrl = mainUrl + this.selectFirst("a.short_img img")?.attr("data-src") + + return newMovieSearchResponse(title, href, TvType.Movie) { + this.posterUrl = posterUrl + } + + } + + override suspend fun search(query: String): List { + val document = app.post( + url = mainUrl, + data = mapOf( + "do" to "search", + "subaction" to "search", + "story" to query.replace(" ", "+") + ) + ).document + return document.select("div.movie-item.short-item").map { + it.toSearchResponse() + } + } + + // Detailed information + override suspend fun load(url: String): LoadResponse { + val document = app.get(url).document + + // Parse info + val title = document.selectFirst("h1 span.solototle")?.text()?.trim().toString() + val poster = fixUrl(document.selectFirst("div.film-poster img")?.attr("src").toString()) + val tags = document.select("div.film-info > div:nth-child(4) a").map { it.text() } + val year = document.select("div.film-info > div:nth-child(2) a").text().toIntOrNull() + // TODO: Fix Naruto. Its series, not Movie Lol + // https://uakino.club/animeukr/6268-naruto-1-sezon.html + val tvType = + if (url.contains(Regex("(/anime-series)|(/seriesss)|(/cartoonseries)"))) TvType.TvSeries else TvType.Movie + val description = document.selectFirst("div[itemprop=description]")?.text()?.trim() + val trailer = document.selectFirst("iframe#pre")?.attr("data-src") + val rating = document.selectFirst("div.film-info > div:nth-child(8) div.fi-desc")?.text() + ?.substringBefore("/").toRatingInt() + val actors = document.select("div.film-info > div:nth-child(6) a").map { it.text() } + + val recommendations = document.select("div#full-slides div.owl-item").map { + it.toSearchResponse() + } + + // Return to app + // Parse Episodes as Series + return if (tvType == TvType.TvSeries) { + val id = url.split("/").last().split("-").first() + val episodes = + app.get("$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&time=${Date().time}") + .parsedSafe()?.response.let { + Jsoup.parse(it.toString()).select("div.playlists-videos li").mapNotNull { eps -> + val href = "$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&time=${Date().time}" + val name = eps.text().trim() // Серія 1 + if (href.isNotEmpty()) { + Episode( + "$href,$name", // link, Серія 1 + name, + ) + } else { + null + } + } + } + newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes.distinctBy{ it.name }) { + this.posterUrl = poster + this.year = year + this.plot = description + this.tags = tags + this.rating = rating + addActors(actors) + this.recommendations = recommendations + addTrailer(trailer) + } + } else { // Parse as Movie. + newMovieLoadResponse(title, url, TvType.Movie, url) { + this.posterUrl = poster + this.year = year + this.plot = description + this.tags = tags + this.rating = rating + addActors(actors) + this.recommendations = recommendations + addTrailer(trailer) + } + } + } + + // It works when I click to view the series + override suspend fun loadLinks( + data: String, // link, episode name + isCasting: Boolean, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ): Boolean { + val dataList = data.split(",") + // TODO: OPTIMIZE code!!! Remove this shitty code as soon as possible!!!!!! + if(dataList.size == 1){ + val id = data.split("/").last().split("-").first() + val responseGet = app.get("$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&time=${Date().time}").parsedSafe() + if (responseGet?.success == true) { // Its serial + responseGet?.response?.let { + Jsoup.parse(it).select("div.playlists-videos li") + .mapNotNull { eps -> + var href = eps.attr("data-file") // ashdi + // Can be without https: + if (!href.contains("https://")) { + href = "https:$href" + } + val dub = eps.attr("data-voice") // FanWoxUA + + // Get m3u from player script + app.get(href, referer = "$mainUrl/").document.select("script") + .map { script -> + if (script.data().contains("var player = new Playerjs({")) { + val m3uLink = script.data().substringAfterLast("file:\"") + .substringBefore("\",") + + // Add as source + M3u8Helper.generateM3u8( + source = dub, + streamUrl = m3uLink, + referer = "https://ashdi.vip/" + ).forEach(callback) + } + } + } + } + } else { + // Its maybe film + val document = app.get(data).document + val iframeUrl = document.selectFirst("iframe#pre")?.attr("src") + // Get m3u from player script + if (iframeUrl != null) { + app.get(iframeUrl, referer = "$mainUrl/").document.select("script").map { script -> + if (script.data().contains("var player = new Playerjs({")) { + val m3uLink = script.data().substringAfterLast("file:\"").substringBefore("\",") + + // Add as source + M3u8Helper.generateM3u8( + source = document.selectFirst("h1 span.solototle")?.text()?.trim().toString(), + streamUrl = m3uLink, + referer = "https://ashdi.vip/" + ).forEach(callback) + } + } + } + } + return true + } + + val responseGet = app.get(dataList[0]).parsedSafe() // ajax link + if (responseGet?.success == true){ // Its serial + responseGet?.response?.let { + Jsoup.parse(it).select("div.playlists-videos li:contains(${dataList[1]})").mapNotNull { eps -> + var href = eps.attr("data-file") // ashdi + // Can be without https: + if (! href.contains("https://")) { + href = "https:$href" + } + val dub = eps.attr("data-voice") // FanWoxUA + + // Get m3u from player script + app.get(href, referer = "$mainUrl/").document.select("script").map { script -> + if (script.data().contains("var player = new Playerjs({")) { + val m3uLink = script.data().substringAfterLast("file:\"").substringBefore("\",") + + // Add as source + M3u8Helper.generateM3u8( + source = dub, + streamUrl = m3uLink, + referer = "https://ashdi.vip/" + ).forEach(callback) + } + } + } + } + } else { + // Its maybe film + val document = app.get(data).document + val iframeUrl = document.selectFirst("iframe#pre")?.attr("src") + // Get m3u from player script + if (iframeUrl != null) { + app.get(iframeUrl, referer = "$mainUrl/").document.select("script").map { script -> + if (script.data().contains("var player = new Playerjs({")) { + val m3uLink = script.data().substringAfterLast("file:\"").substringBefore("\",") + + // Add as source + M3u8Helper.generateM3u8( + source = document.selectFirst("h1 span.solototle")?.text()?.trim().toString(), + streamUrl = m3uLink, + referer = "https://ashdi.vip/" + ).forEach(callback) + } + } + } + } + + + return true + } + + data class Responses( + val success: Boolean?, + val response: String, + ) + +} \ No newline at end of file diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProviderPlugin.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProviderPlugin.kt new file mode 100644 index 0000000..70c405b --- /dev/null +++ b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProviderPlugin.kt @@ -0,0 +1,13 @@ +package com.lagradost + +import com.lagradost.cloudstream3.plugins.CloudstreamPlugin +import com.lagradost.cloudstream3.plugins.Plugin +import android.content.Context + +@CloudstreamPlugin +class EneyidaProviderPlugin: Plugin() { + override fun load(context: Context) { + // All providers should be added in this manner. Please don't edit the providers list directly. + registerMainAPI(EneyidaProvider()) + } +} \ No newline at end of file From 2e9997e4c16426c94f1d0b273d7ffffab7847d18 Mon Sep 17 00:00:00 2001 From: CakesTwix Date: Fri, 17 Feb 2023 18:04:12 +0200 Subject: [PATCH 2/5] Eneyida:gradle: Update info --- EneyidaProvider/build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EneyidaProvider/build.gradle.kts b/EneyidaProvider/build.gradle.kts index 3c2f1d2..8222eec 100644 --- a/EneyidaProvider/build.gradle.kts +++ b/EneyidaProvider/build.gradle.kts @@ -1,12 +1,12 @@ // use an integer for version numbers -version = 2 +version = 1 cloudstream { language = "uk" // All of these properties are optional, you can safely remove them - description = "Дивитися фільми та серіали онлайн в HD якості. У нас можна дивитися кіно онлайн безкоштовно, у високій якості та з якісним українським дубляжем." + description = "Мета проекту «Енеїда» - популяризація української мови, демонстрація її різнобарвності та сучасності. Ми плануємо робити це через ретрансляцію якісного кіно, мультфільмів, телесеріалів та різноманітних телешоу в якісному українському перекладі. Тож, у добрий шлях дорогі конфіденти!." authors = listOf("CakesTwix") /** @@ -16,12 +16,12 @@ cloudstream { * 2: Slow * 3: Beta only * */ - status = 1 // will be 3 if unspecified + status = 3 // will be 3 if unspecified tvTypes = listOf( "Anime", "TvSeries", "Movie", ) - iconUrl = "https://www.google.com/s2/favicons?domain=uakino.club&sz=%size%" + iconUrl = "https://www.google.com/s2/favicons?domain=eneyida.tv&sz=%size%" } \ No newline at end of file From 59b084b247a28a438fa6cce58fe277759d3f3995 Mon Sep 17 00:00:00 2001 From: CakesTwix Date: Fri, 17 Feb 2023 19:32:50 +0200 Subject: [PATCH 3/5] Eneyida: Parse general info --- .../kotlin/com/lagradost/EneyidaProvider.kt | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt index 318beea..ed934c8 100644 --- a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt +++ b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt @@ -48,7 +48,7 @@ class EneyidaProvider : MainAPI() { private fun Element.toSearchResponse(): SearchResponse { val title = this.selectFirst("a.short_title")?.text()?.trim().toString() - val href = this.selectFirst("div.short_title")?.attr("href").toString() + val href = this.selectFirst("a.short_title")?.attr("href").toString() val posterUrl = mainUrl + this.selectFirst("a.short_img img")?.attr("data-src") return newMovieSearchResponse(title, href, TvType.Movie) { @@ -76,21 +76,20 @@ class EneyidaProvider : MainAPI() { val document = app.get(url).document // Parse info - val title = document.selectFirst("h1 span.solototle")?.text()?.trim().toString() - val poster = fixUrl(document.selectFirst("div.film-poster img")?.attr("src").toString()) - val tags = document.select("div.film-info > div:nth-child(4) a").map { it.text() } - val year = document.select("div.film-info > div:nth-child(2) a").text().toIntOrNull() - // TODO: Fix Naruto. Its series, not Movie Lol - // https://uakino.club/animeukr/6268-naruto-1-sezon.html - val tvType = - if (url.contains(Regex("(/anime-series)|(/seriesss)|(/cartoonseries)"))) TvType.TvSeries else TvType.Movie - val description = document.selectFirst("div[itemprop=description]")?.text()?.trim() - val trailer = document.selectFirst("iframe#pre")?.attr("data-src") - val rating = document.selectFirst("div.film-info > div:nth-child(8) div.fi-desc")?.text() - ?.substringBefore("/").toRatingInt() - val actors = document.select("div.film-info > div:nth-child(6) a").map { it.text() } + val full_info = document.select(".full_info li") + val title = document.selectFirst("div.full_header-title h1")?.text()?.trim().toString() + val poster = mainUrl + document.selectFirst(".full_content-poster img")?.attr("src") + val tags = full_info[1].select("a").map { it.text() } + val year = full_info[0].select("a").text().toIntOrNull() + val playerUrl = document.select(".tabs_b.visible iframe").attr("src") - val recommendations = document.select("div#full-slides div.owl-item").map { + val tvType = if (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() + val actors = full_info[4].select("a").map { it.text() } + + val recommendations = document.select(".short.related_item").map { it.toSearchResponse() } From ebe06c226d1882df954196a86c35e078b0d9919b Mon Sep 17 00:00:00 2001 From: CakesTwix Date: Fri, 17 Feb 2023 22:43:27 +0200 Subject: [PATCH 4/5] Eneyida: Parse all episodes --- .../kotlin/com/lagradost/EneyidaProvider.kt | 163 +++++------------- .../kotlin/com/lagradost/models/PlayerJson.kt | 22 +++ 2 files changed, 69 insertions(+), 116 deletions(-) create mode 100644 EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt index ed934c8..240e80a 100644 --- a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt +++ b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt @@ -1,13 +1,14 @@ package com.lagradost import android.util.Log +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.tryParseJson import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.M3u8Helper import org.jsoup.Jsoup -import org.jsoup.nodes.Document import org.jsoup.nodes.Element import java.util.* @@ -74,7 +75,6 @@ class EneyidaProvider : MainAPI() { // Detailed information override suspend fun load(url: String): LoadResponse { val document = app.get(url).document - // Parse info val full_info = document.select(".full_info li") val title = document.selectFirst("div.full_header-title h1")?.text()?.trim().toString() @@ -96,24 +96,27 @@ class EneyidaProvider : MainAPI() { // Return to app // Parse Episodes as Series return if (tvType == TvType.TvSeries) { - val id = url.split("/").last().split("-").first() - val episodes = - app.get("$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&time=${Date().time}") - .parsedSafe()?.response.let { - Jsoup.parse(it.toString()).select("div.playlists-videos li").mapNotNull { eps -> - val href = "$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&time=${Date().time}" - val name = eps.text().trim() // Серія 1 - if (href.isNotEmpty()) { - Episode( - "$href,$name", // link, Серія 1 - name, - ) - } else { - null - } - } + var episodes: List = emptyList() + val playerRawJson = app.get(playerUrl).document.select("script").html() + .substringAfterLast("file:\'") + .substringBefore("\',") + + tryParseJson>(playerRawJson)?.map { dubs -> // Dubs + for(season in dubs.folder){ // Seasons + for(episode in season.folder){ // Episodes + episodes = episodes.plus( + Episode( + "${season.title}, ${episode.title}, $playerUrl", + episode.title, + season.title.replace(" Сезон ","").toIntOrNull(), + episode.title.replace("Серія ","").toIntOrNull(), + episode.poster + ) + ) } - newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes.distinctBy{ it.name }) { + } + } + newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) { this.posterUrl = poster this.year = year this.plot = description @@ -124,7 +127,7 @@ class EneyidaProvider : MainAPI() { addTrailer(trailer) } } else { // Parse as Movie. - newMovieLoadResponse(title, url, TvType.Movie, url) { + newMovieLoadResponse(title, url, TvType.Movie, "$title, $playerUrl") { this.posterUrl = poster this.year = year this.plot = description @@ -139,121 +142,49 @@ class EneyidaProvider : MainAPI() { // It works when I click to view the series override suspend fun loadLinks( - data: String, // link, episode name + data: String, // (Serisl) [Season, Episode, Player Url] | (Film) [Title, Player Url] isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ): Boolean { - val dataList = data.split(",") - // TODO: OPTIMIZE code!!! Remove this shitty code as soon as possible!!!!!! - if(dataList.size == 1){ - val id = data.split("/").last().split("-").first() - val responseGet = app.get("$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&time=${Date().time}").parsedSafe() - if (responseGet?.success == true) { // Its serial - responseGet?.response?.let { - Jsoup.parse(it).select("div.playlists-videos li") - .mapNotNull { eps -> - var href = eps.attr("data-file") // ashdi - // Can be without https: - if (!href.contains("https://")) { - href = "https:$href" - } - val dub = eps.attr("data-voice") // FanWoxUA + val dataList = data.split(", ") - // Get m3u from player script - app.get(href, referer = "$mainUrl/").document.select("script") - .map { script -> - if (script.data().contains("var player = new Playerjs({")) { - val m3uLink = script.data().substringAfterLast("file:\"") - .substringBefore("\",") + // Its film, parse one m3u8 + if(dataList.size == 2){ + val m3u8Url = app.get(dataList[1]).document.select("script").html() + .substringAfterLast("file:\"") + .substringBefore("\",") + Log.d("loadLinks-debug", m3u8Url) + M3u8Helper.generateM3u8( + source = dataList[0], + streamUrl = m3u8Url, + referer = "https://tortuga.wtf/" + ).forEach(callback) - // Add as source - M3u8Helper.generateM3u8( - source = dub, - streamUrl = m3uLink, - referer = "https://ashdi.vip/" - ).forEach(callback) - } - } - } - } - } else { - // Its maybe film - val document = app.get(data).document - val iframeUrl = document.selectFirst("iframe#pre")?.attr("src") - // Get m3u from player script - if (iframeUrl != null) { - app.get(iframeUrl, referer = "$mainUrl/").document.select("script").map { script -> - if (script.data().contains("var player = new Playerjs({")) { - val m3uLink = script.data().substringAfterLast("file:\"").substringBefore("\",") - - // Add as source - M3u8Helper.generateM3u8( - source = document.selectFirst("h1 span.solototle")?.text()?.trim().toString(), - streamUrl = m3uLink, - referer = "https://ashdi.vip/" - ).forEach(callback) - } - } - } - } return true } - val responseGet = app.get(dataList[0]).parsedSafe() // ajax link - if (responseGet?.success == true){ // Its serial - responseGet?.response?.let { - Jsoup.parse(it).select("div.playlists-videos li:contains(${dataList[1]})").mapNotNull { eps -> - var href = eps.attr("data-file") // ashdi - // Can be without https: - if (! href.contains("https://")) { - href = "https:$href" - } - val dub = eps.attr("data-voice") // FanWoxUA - - // Get m3u from player script - app.get(href, referer = "$mainUrl/").document.select("script").map { script -> - if (script.data().contains("var player = new Playerjs({")) { - val m3uLink = script.data().substringAfterLast("file:\"").substringBefore("\",") + val playerRawJson = app.get(dataList[2]).document.select("script").html() + .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 = dub, - streamUrl = m3uLink, - referer = "https://ashdi.vip/" + source = dubs.title, + streamUrl = episode.file, + referer = "https://tortuga.wtf/" ).forEach(callback) } } } } - } else { - // Its maybe film - val document = app.get(data).document - val iframeUrl = document.selectFirst("iframe#pre")?.attr("src") - // Get m3u from player script - if (iframeUrl != null) { - app.get(iframeUrl, referer = "$mainUrl/").document.select("script").map { script -> - if (script.data().contains("var player = new Playerjs({")) { - val m3uLink = script.data().substringAfterLast("file:\"").substringBefore("\",") - - // Add as source - M3u8Helper.generateM3u8( - source = document.selectFirst("h1 span.solototle")?.text()?.trim().toString(), - streamUrl = m3uLink, - referer = "https://ashdi.vip/" - ).forEach(callback) - } - } - } } - - return true } - data class Responses( - val success: Boolean?, - val response: String, - ) - } \ No newline at end of file diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt new file mode 100644 index 0000000..163dd77 --- /dev/null +++ b/EneyidaProvider/src/main/kotlin/com/lagradost/models/PlayerJson.kt @@ -0,0 +1,22 @@ +package com.lagradost.models + +data class PlayerJson ( + + val title : String, + val folder : List +) + +data class Season ( + + val title : String, + val folder : List +) + +data class Episode ( + + val title : String, + val file : String, + val id : String, + val poster : String, + val subtitle : String, +) From a57cf0db3c23c2ef316a1008ad580bd1de0e3564 Mon Sep 17 00:00:00 2001 From: CakesTwix Date: Fri, 17 Feb 2023 22:59:55 +0200 Subject: [PATCH 5/5] Eneyida: fix search --- .../src/main/kotlin/com/lagradost/EneyidaProvider.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt b/EneyidaProvider/src/main/kotlin/com/lagradost/EneyidaProvider.kt index 240e80a..48def72 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 @@ -8,9 +7,7 @@ import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.M3u8Helper -import org.jsoup.Jsoup import org.jsoup.nodes.Element -import java.util.* class EneyidaProvider : MainAPI() { @@ -60,14 +57,15 @@ class EneyidaProvider : MainAPI() { override suspend fun search(query: String): List { val document = app.post( - url = mainUrl, + url = "$mainUrl", data = mapOf( "do" to "search", "subaction" to "search", "story" to query.replace(" ", "+") ) ).document - return document.select("div.movie-item.short-item").map { + + return document.select("article.short").map { it.toSearchResponse() } } @@ -154,7 +152,6 @@ class EneyidaProvider : MainAPI() { val m3u8Url = app.get(dataList[1]).document.select("script").html() .substringAfterLast("file:\"") .substringBefore("\",") - Log.d("loadLinks-debug", m3u8Url) M3u8Helper.generateM3u8( source = dataList[0], streamUrl = m3u8Url,