Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
imper1aldev committed Oct 4, 2023
1 parent d6b5cf3 commit c9bab3f
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import java.util.*

class AnimefenixProvider:MainAPI() {

override var mainUrl = "https://animefenix.com"
override var mainUrl = "https://animefenix.tv"
override var name = "Animefenix"
override var lang = "es"
override val hasMainPage = true
Expand Down
25 changes: 25 additions & 0 deletions HentaiLAProvider/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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("Cloudburst")

/**
* Status int as the following:
* 0: Down
* 1: Ok
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"Anime", "AnimeMovie", "OVA"
)

iconUrl = "https://www.google.com/s2/favicons?domain=www.zonevipz.com&sz=%size%"
}
2 changes: 2 additions & 0 deletions HentaiLAProvider/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.lagradost"/>
112 changes: 112 additions & 0 deletions HentaiLAProvider/src/main/kotlin/com/lagradost/HentaiLAProvider.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package com.lagradost

import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import java.util.*

class HentaiLAProvider : MainAPI() {

override var mainUrl = "https://hentaila.tv"
override var name = "HentaiLA"
override var lang = "es"
override val hasMainPage = true
override val hasChromecastSupport = true
override val hasDownloadSupport = true

override val supportedTypes = setOf(
TvType.Anime, TvType.AnimeMovie, TvType.OVA
)

override val mainPage = mainPageOf(
Pair("$mainUrl/page/%d/?m_orderby=latest", "Recientes"),
Pair("$mainUrl/page/%d/?m_orderby=rating", "Populares")
)

override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val items = ArrayList<HomePageList>()
val soup = app.get(String.format(request.data, page)).document
val hasNextPage = soup.select(".wp-pagenavi a.nextpostslink").any()

val home = soup.select(".item_card").map {
val title = it.selectFirst("a .card__title")!!.text()
val poster = it.selectFirst("a img")!!.attr("abs:src")
AnimeSearchResponse(
title,
fixUrl(it.selectFirst("a")!!.attr("abs:href")),
this.name,
TvType.Anime,
poster,
null,
EnumSet.of(DubStatus.Subbed)
)
}

items.add(HomePageList(request.name, home))
if (items.size <= 0) throw ErrorLoadingException()
return HomePageResponse(items, hasNextPage)
}

override suspend fun search(query: String): List<SearchResponse> {
val soup = app.get("$mainUrl/?s=$query").document
return soup.select(".item_card").map {
val title = it.selectFirst("a .card__title")!!.text()
val poster = it.selectFirst("a img")!!.attr("abs:src")
AnimeSearchResponse(
title,
fixUrl(it.selectFirst("a")!!.attr("abs:href")),
this.name,
TvType.Anime,
poster,
null,
EnumSet.of(DubStatus.Subbed)
)
}
}

override suspend fun load(url: String): LoadResponse? {
// Gets the url returned from searching.
val soup = app.get(url).document
val title = soup.selectFirst(".hentai_cover img")!!.attr("alt").substringBefore("cover").trim()
val description = soup.selectFirst("div.vraven_expand > div.vraven_text.single > p")!!.text()

val episodes = soup.select(".hentai__episodes .hentai__chapter").map {
val href = it.select("a").attr("abs:href")
val poster = it.select("a img").attr("abs:src")
val noEpisode = it.select("a").text().filter { it.isDigit() }.toFloat()

Episode(href, episode = noEpisode.toInt(), posterUrl = poster)
}

return newAnimeLoadResponse(title, url, TvType.Anime) {
posterUrl = soup.selectFirst(".hentai_cover img")!!.attr("abs:src")
addEpisodes(DubStatus.Subbed, episodes)
showStatus = ShowStatus.Completed
plot = description
}
}

override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
app.get(data).document.select("script").apmap { script ->
if (script.data().contains("window.hola_player({")) {
script.data().substringAfter("sources: [{src: \"").substringBefore("\",").let { url ->
callback.invoke(
ExtractorLink(
this.name,
this.name,
url,
referer = "",
quality = Qualities.P720.value
)
)
}
}
}
return true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

package com.lagradost

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

@CloudstreamPlugin
class HentaiLAProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(HentaiLAProvider())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class YomirollProvider : MainAPI() {
private suspend fun getEpisodes(seasonData: SeasonResult.Season): List<Episode> {
val episodes = app.get(
"$crApiUrl/cms/seasons/${seasonData.id}/episodes",
headers = getCrunchyrollToken()
interceptor = tokenInterceptor
).parsed<EpisodeResult>()
return episodes.data.sortedBy { it.episode_number }.mapNotNull EpisodeMap@{ ep ->
Episode(
Expand Down Expand Up @@ -281,7 +281,7 @@ class YomirollProvider : MainAPI() {
val (mediaId, audioL) = it
val streams = app.get(
"https://beta-api.crunchyroll.com/content/v2/cms/videos/$mediaId/streams",
headers = getCrunchyrollToken(),
interceptor = tokenInterceptor,
timeout = 20000
).parsedSafe<CrunchyrollSourcesResponses>()

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rootProject.name = "CloudstreamPlugins"

// Plugins are included like this
val disabled = listOf<String>(
"AnimefenixProvider"
// "AnimefenixProvider"
)

File(rootDir, ".").eachDir { dir ->
Expand Down

0 comments on commit c9bab3f

Please sign in to comment.