mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed NontonAnimeID
This commit is contained in:
parent
082544ad29
commit
cb11c787df
4 changed files with 20 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 14
|
||||
version = 15
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -3,13 +3,15 @@ package com.hexated
|
|||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||
import com.lagradost.cloudstream3.extractors.Hxfile
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Element
|
||||
import java.net.URI
|
||||
|
||||
class NontonAnimeIDProvider : MainAPI() {
|
||||
override var mainUrl = "https://nontonanimeid.fun"
|
||||
override var mainUrl = "https://nontonanimeid.bio"
|
||||
override var name = "NontonAnimeID"
|
||||
override val hasQuickSearch = false
|
||||
override val hasMainPage = true
|
||||
|
@ -114,7 +116,9 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
app.get(url).document.selectFirst("div.nvs.nvsc a")?.attr("href")
|
||||
}
|
||||
|
||||
val document = app.get(fixUrl ?: return null).document
|
||||
val req = app.get(fixUrl ?: return null)
|
||||
mainUrl = getBaseUrl(req.url)
|
||||
val document = req.document
|
||||
|
||||
val title = document.selectFirst("h1.entry-title.cs")!!.text().removeSurrounding("Nonton Anime", "Sub Indo").trim()
|
||||
val poster = document.selectFirst(".poster > img")?.attr("data-src")
|
||||
|
@ -227,6 +231,11 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
private fun getBaseUrl(url: String): String {
|
||||
return URI(url).let {
|
||||
"${it.scheme}://${it.host}"
|
||||
}
|
||||
}
|
||||
private data class EpResponse(
|
||||
@JsonProperty("posts") val posts: String?,
|
||||
@JsonProperty("max_page") val max_page: Int?,
|
||||
|
@ -235,3 +244,9 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
)
|
||||
|
||||
}
|
||||
|
||||
class KotakAnimeid2 : Hxfile() {
|
||||
override val name = "KotakAnimeid2"
|
||||
override val mainUrl = "https://embed2.kotakanimeid.com"
|
||||
override val requiresReferer = true
|
||||
}
|
||||
|
|
|
@ -10,5 +10,6 @@ class NontonAnimeIDProviderPlugin: Plugin() {
|
|||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(NontonAnimeIDProvider())
|
||||
registerExtractorAPI(KotakAnimeid2())
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 139
|
||||
version = 140
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
Loading…
Reference in a new issue