From e61bc00168f7ab7ed77964421a33798b5ddacfb1 Mon Sep 17 00:00:00 2001 From: CakesTwix Date: Wed, 15 Feb 2023 18:19:57 +0200 Subject: [PATCH] uakino: Removed duplicate episodes This is preparation for moving the dubbing to the sources for the series. --- .../main/kotlin/com/lagradost/UakinoProvider.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/UakinoProvider/src/main/kotlin/com/lagradost/UakinoProvider.kt b/UakinoProvider/src/main/kotlin/com/lagradost/UakinoProvider.kt index 09656cb..327fd64 100644 --- a/UakinoProvider/src/main/kotlin/com/lagradost/UakinoProvider.kt +++ b/UakinoProvider/src/main/kotlin/com/lagradost/UakinoProvider.kt @@ -1,5 +1,6 @@ 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 @@ -69,6 +70,7 @@ class UakinoProvider : MainAPI() { } } + // Detailed information override suspend fun load(url: String): LoadResponse { val document = app.get(url).document @@ -98,9 +100,9 @@ class UakinoProvider : MainAPI() { 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("ul > li").mapNotNull { eps -> - val href = fixUrl(eps.attr("data-file")) // ashdi.vip/... - val name = "${eps.text().trim()} (${eps.attr("data-voice")})" // Серія 1 (Озвучення) + 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, @@ -111,7 +113,7 @@ class UakinoProvider : MainAPI() { } } } - newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) { + newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes.distinctBy{ it.name }) { this.posterUrl = poster this.year = year this.plot = description @@ -135,15 +137,16 @@ class UakinoProvider : MainAPI() { } } + // It works when I click to view the series override suspend fun loadLinks( - data: String, + data: String, // Link from load -> Episode -> data (https://uakino.club/engine/ajax/playlists.php?news_id=16379&xfield=playlist&time=1676477550880) isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ): Boolean { val links = ArrayList() - + // TODO: Redo the logic. Put voices in sources if (data.startsWith("https://ashdi.vip")) { links.add(data) } else {