Skip to content

Commit

Permalink
Merge pull request #16 from redblacker8/master
Browse files Browse the repository at this point in the history
Added sololatino animjl, fixed pp4k cuevan, updated cinecal peliphd
  • Loading branch information
Stormunblessed authored Aug 27, 2024
2 parents 0357edd + 2984fd1 commit 1d485e4
Show file tree
Hide file tree
Showing 18 changed files with 433 additions and 141 deletions.
26 changes: 26 additions & 0 deletions AnimeJlProvider/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 2 additions & 0 deletions AnimeJlProvider/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.stormunblessed"/>
140 changes: 140 additions & 0 deletions AnimeJlProvider/src/main/kotlin/com/stormunblessed/AnimeJlProvider.kt
Original file line number Diff line number Diff line change
@@ -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<HomePageList>()
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<SearchResponse> {
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<Episode>()
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<List<List<String>>>(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 = """(<iframe src=)"(.*?)"""".toRegex()
app.get(data).document.select("script")
.firstOrNull { it.html().contains("var video = [];") }?.let { frameUrl ->
regex.findAll(frameUrl.html()).map { it.groupValues.get(2) }.toList().apmap {
loadExtractor(it, data, subtitleCallback, callback)
}
}
return true
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.stormunblessed

import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context

@CloudstreamPlugin
class AnimeJlProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(AnimeJlProvider())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class CablevisionHdProvider : MainAPI() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
app.get(data).document.select("a.btn.btn-md").forEach {
app.get(data).document.select("a.btn.btn-md").map {
val trembedlink = it.attr("href")
if (trembedlink.contains("/stream")) {
val tremrequest = app.get(trembedlink, headers = mapOf(
Expand Down
2 changes: 1 addition & 1 deletion CinecalidadProvider/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// use an integer for version numbers
version = 4
version = 5


cloudstream {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor

class CinecalidadProvider : MainAPI() {
override var mainUrl = "https://cinecalidad.lol"
override var mainUrl = "https://www.cinecalidad.ec"
override var name = "Cinecalidad"
override var lang = "es"
override val hasMainPage = true
Expand Down Expand Up @@ -52,10 +52,10 @@ class CinecalidadProvider : MainAPI() {
val url = "$mainUrl/?s=${query}"
val document = app.get(url).document

return document.select("article").map {
return document.select("article.item").map {
val title = it.selectFirst("div.in_title")!!.text()
val href = it.selectFirst("a")!!.attr("href")
val image = it.selectFirst(".poster.custom img")!!.attr("data-src")
val image = it.selectFirst("img.lazy")!!.attr("data-src")
val isMovie = href.contains("/ver-pelicula/")

if (isMovie) {
Expand Down
4 changes: 2 additions & 2 deletions CuevanaProvider/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// use an integer for version numbers
version = 8
version = 9


cloudstream {
Expand All @@ -16,7 +16,7 @@ cloudstream {
* 2: Slow
* 3: Beta only
* */
status = 0 // will be 3 if unspecified
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"TvSeries",
"Movie",
Expand Down
Loading

0 comments on commit 1d485e4

Please sign in to comment.