fixed Otakudesu, Rebahin, Kuramanime

This commit is contained in:
hexated 2022-12-29 18:48:41 +07:00
parent 57ebef9198
commit 25e2deb249
7 changed files with 16 additions and 15 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 5
version = 6
cloudstream {

View File

@ -91,7 +91,7 @@ class KuramanimeProvider : MainAPI() {
val link = "$mainUrl/anime?search=$query&order_by=latest"
val document = app.get(link).document
return document.select("div#animeList div.col-lg-4.col-md-6.col-sm-6").mapNotNull {
return document.select("div#animeList div.product__item").mapNotNull {
it.toSearchResult()
}
}
@ -123,12 +123,17 @@ class KuramanimeProvider : MainAPI() {
)
).parsedSafe<DataAni>()?.data?.media?.id
val episodes =
Jsoup.parse(document.select("#episodeLists").attr("data-content")).select("a").map {
val episodes = mutableListOf<Episode>()
for (i in 1..5) {
val doc = app.get("$url?page=$i").document
val eps = Jsoup.parse(doc.select("#episodeLists").attr("data-content")).select("a").mapNotNull {
val name = it.text().trim()
val link = it.attr("href")
Episode(link, name)
}
}.filter { it.name?.contains(Regex("(?i)(Terlama)|(Terbaru)")) == false }
if(eps.isEmpty()) break else episodes.addAll(eps)
}
val recommendations = document.select("div#randomList > a").mapNotNull {
val epHref = it.attr("href")

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 5
version = 6
cloudstream {

View File

@ -181,7 +181,7 @@ class OtakudesuProvider : MainAPI() {
data
// , interceptor = interceptor
).document
val scriptData = document.select("script").last()?.data()
val scriptData = document.select("script:containsData(action:)").lastOrNull()?.data()
val token = scriptData?.substringAfter("{action:\"")?.substringBefore("\"}").toString()
val nonce = app.post("$mainUrl/wp-admin/admin-ajax.php", data = mapOf("action" to token))

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 4
version = 5
cloudstream {

View File

@ -13,7 +13,7 @@ import org.jsoup.nodes.Element
import java.net.URI
open class RebahinProvider : MainAPI() {
override var mainUrl = "http://104.237.198.197"
override var mainUrl = "http://104.237.198.198"
override var name = "Rebahin"
override val hasMainPage = true
override var lang = "id"

View File

@ -1565,17 +1565,13 @@ object SoraExtractor : SoraStream() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val fixTitle = title?.replace(":", "")
val fixTitle = title?.fixTitle()?.replace("-", " ")
val doc = app.get("$moviezAddAPI/?s=$fixTitle").document
// TODO find better way
val matchMedia = doc.select("article.mh-loop-item").map {
it.select("a").attr("href") to it.select("a").text()
}.find {
(it.second.contains("$fixTitle", true) || it.second.contains(
"$title",
true
)) && it.first.contains("$year")
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.first.contains("$year")
}
val detailLink =