From 2984fd1e1523ab5d2f5a197ed077c57d64bd84c2 Mon Sep 17 00:00:00 2001 From: redblacker8 Date: Fri, 23 Aug 2024 13:36:04 -0600 Subject: [PATCH] Added sololatino animjl, fixed pp4k cuevan, updated cinecal peliphd --- AnimeJlProvider/build.gradle.kts | 26 +++ AnimeJlProvider/src/main/AndroidManifest.xml | 2 + .../com/stormunblessed/AnimeJlProvider.kt | 140 ++++++++++++++++ .../stormunblessed/AnimeJlProviderPlugin.kt | 13 ++ .../stormunblessed/CablevisionHdProvider.kt | 2 +- CinecalidadProvider/build.gradle.kts | 2 +- .../com/stormunblessed/CinecalidadProvider.kt | 6 +- CuevanaProvider/build.gradle.kts | 4 +- .../com/stormunblessed/CuevanaProvider.kt | 119 ++------------ MundoDonghuaProvider/build.gradle.kts | 1 + Pelisplus4KProvider/build.gradle.kts | 6 +- .../com/stormunblessed/Pelisplus4KProvider.kt | 51 +++--- PelisplusHDProvider/build.gradle.kts | 2 +- .../com/stormunblessed/PelisplusHDProvider.kt | 2 +- SoloLatinoProvider/build.gradle.kts | 28 ++++ .../src/main/AndroidManifest.xml | 2 + .../com/stormunblessed/SoloLatinoProvider.kt | 155 ++++++++++++++++++ .../SoloLatinoProviderPlugin.kt | 13 ++ 18 files changed, 433 insertions(+), 141 deletions(-) create mode 100644 AnimeJlProvider/build.gradle.kts create mode 100644 AnimeJlProvider/src/main/AndroidManifest.xml create mode 100644 AnimeJlProvider/src/main/kotlin/com/stormunblessed/AnimeJlProvider.kt create mode 100644 AnimeJlProvider/src/main/kotlin/com/stormunblessed/AnimeJlProviderPlugin.kt create mode 100644 SoloLatinoProvider/build.gradle.kts create mode 100644 SoloLatinoProvider/src/main/AndroidManifest.xml create mode 100644 SoloLatinoProvider/src/main/kotlin/com/stormunblessed/SoloLatinoProvider.kt create mode 100644 SoloLatinoProvider/src/main/kotlin/com/stormunblessed/SoloLatinoProviderPlugin.kt diff --git a/AnimeJlProvider/build.gradle.kts b/AnimeJlProvider/build.gradle.kts new file mode 100644 index 0000000..58dc3f5 --- /dev/null +++ b/AnimeJlProvider/build.gradle.kts @@ -0,0 +1,26 @@ +// use an integer for version numbers +version = 1 + + +cloudstream { + language = "es" + // All of these properties are optional, you can safely remove them + + //description = "Lorem Ipsum" + authors = listOf("misajimenezmx") + + /** + * Status int as the following: + * 0: Down + * 1: Ok + * 2: Slow + * 3: Beta only + * */ + status = 1 // will be 3 if unspecified + tvTypes = listOf( + "Movie", + "Anime", + ) + + iconUrl = "https://www.anime-jl.net/favicon.ico" +} \ No newline at end of file diff --git a/AnimeJlProvider/src/main/AndroidManifest.xml b/AnimeJlProvider/src/main/AndroidManifest.xml new file mode 100644 index 0000000..15d9019 --- /dev/null +++ b/AnimeJlProvider/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/AnimeJlProvider/src/main/kotlin/com/stormunblessed/AnimeJlProvider.kt b/AnimeJlProvider/src/main/kotlin/com/stormunblessed/AnimeJlProvider.kt new file mode 100644 index 0000000..e7c772f --- /dev/null +++ b/AnimeJlProvider/src/main/kotlin/com/stormunblessed/AnimeJlProvider.kt @@ -0,0 +1,140 @@ +package com.stormunblessed + +import android.util.Log +import com.lagradost.cloudstream3.* +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.loadExtractor +import com.lagradost.cloudstream3.utils.AppUtils.parseJson + +class AnimeJlProvider : MainAPI() { + override var mainUrl = "https://www.anime-jl.net" + override var name = "AnimeJL" + override var lang = "es" + override val hasMainPage = true + override val hasChromecastSupport = true + override val hasDownloadSupport = true + override val supportedTypes = setOf( + TvType.Movie, + TvType.Anime, + ) + + override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse? { + val items = ArrayList() + val urls = listOf( + Pair("Latino", "$mainUrl/animes?genre[]=46&order=updated"), + Pair("Animes", "$mainUrl/animes"), + Pair("Donghuas", "$mainUrl/animes?tipo[]=7&order=updated"), + Pair("Peliculas", "$mainUrl/animes?tipo[]=3&order=updated"), + ) + + urls.apmap { (name, url) -> + val doc = app.get(url).document + val home = doc.select("ul.ListAnimes li").map { + val title = it.selectFirst("article.Anime h3.Title")?.text() + val link = it.selectFirst("article.Anime a")?.attr("href") + val img = it.selectFirst("article.Anime a div.Image figure img")?.attr("src") + ?.replaceFirst("^/".toRegex(), "$mainUrl/") + TvSeriesSearchResponse( + title!!, + link!!, + this.name, + TvType.Anime, + img, + ) + } + items.add(HomePageList(name, home)) + } + return HomePageResponse(items) + } + + override suspend fun search(query: String): List { + val url = "$mainUrl/animes?q=$query" + val doc = app.get(url).document + return doc.select("ul.ListAnimes li").map { + val title = it.selectFirst("article.Anime h3.Title")?.text() + val link = it.selectFirst("article.Anime a")?.attr("href") + val img = it.selectFirst("article.Anime a div.Image figure img")?.attr("src") + ?.replaceFirst("^/".toRegex(), "$mainUrl/") + TvSeriesSearchResponse( + title!!, + link!!, + this.name, + TvType.Anime, + img, + ) + } + } + + override suspend fun load(url: String): LoadResponse? { + val doc = app.get(url).document + val title = doc.selectFirst("div.Ficha div.Container h1.Title")?.text() ?: "" + val backimage = doc.selectFirst("div.Ficha div.Bg")!!.attr("style") + .substringAfter("background-image:url(").substringBefore(")") + val poster = doc.selectFirst("div.Container div.Image figure img")!!.attr("src") + val description = + doc.selectFirst("div.Container main.Main section.WdgtCn div.Description")!!.text() + val tags = + doc.select("div.Container main.Main section.WdgtCn nav.Nvgnrs a").map { it.text() } + val episodes = ArrayList() + val script = + doc.select("script").firstOrNull { it.html().contains("var episodes =") }?.html() + if (!script.isNullOrEmpty()) { + val jsonscript = + script.substringAfter("episodes = ").substringBefore(";").replace(",]", "]") + val json = parseJson>>(jsonscript) + json.map { list -> + var epNum = 0 + var epTitle = "" + var epurl = "" + var realimg = "" + list.forEachIndexed { idx, it -> + if (idx == 0) { + epNum = it.toIntOrNull() ?: 0 + } else if (idx == 1) { + epurl = "$url/$it" + } else if (idx == 2) { + realimg = "$mainUrl/storage/$it" + } else if (idx == 3) { + epTitle = it.ifEmpty { "Episodio $epNum" } + } + } + episodes.add( + Episode( + epurl, + epTitle, + 0, + epNum, + realimg, + ) + ) + } + } + + return newTvSeriesLoadResponse( + title, + url, TvType.Anime, episodes, + ) { + this.posterUrl = poster + this.backgroundPosterUrl = backimage + this.plot = description + this.tags = tags + } + } + + override suspend fun loadLinks( + data: String, + isCasting: Boolean, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ): Boolean { + val regex = """(