Create UncutMaza.kt
This commit is contained in:
parent
b5ef81f42f
commit
19456eb26e
|
@ -0,0 +1,97 @@
|
||||||
|
package com.hexated
|
||||||
|
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
|
||||||
|
class UncutMaza : MainAPI() {
|
||||||
|
override var mainUrl = "https://uncutmaza.cc"
|
||||||
|
override var name = "UncutMaza"
|
||||||
|
override val hasMainPage = true
|
||||||
|
override var lang = "hi"
|
||||||
|
override val hasQuickSearch = false
|
||||||
|
override val hasDownloadSupport = true
|
||||||
|
override val hasChromecastSupport = true
|
||||||
|
override val supportedTypes = setOf(TvType.NSFW)
|
||||||
|
override val vpnStatus = VPNStatus.MightBeNeeded
|
||||||
|
|
||||||
|
override val mainPage = mainPageOf(
|
||||||
|
"${mainUrl}/page/" to "Home",
|
||||||
|
"${mainUrl}/category/niks-indian-porn/page/" to "Niks Indian"
|
||||||
|
)
|
||||||
|
|
||||||
|
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||||
|
val document = app.get(request.data + page).document
|
||||||
|
val home = document.select("div.videos-list > article.post").mapNotNull { it.toSearchResult() }
|
||||||
|
|
||||||
|
return newHomePageResponse(
|
||||||
|
list = HomePageList(
|
||||||
|
name = request.name,
|
||||||
|
list = home,
|
||||||
|
isHorizontalImages = true
|
||||||
|
),
|
||||||
|
hasNext = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Element.toSearchResult(): SearchResponse {
|
||||||
|
val title = fixTitle(this.select("a").attr("title"))
|
||||||
|
val href = fixUrl(this.select("a").attr("href"))
|
||||||
|
val posterUrl = fixUrlNull(this.select("a > div.post-thumbnail>div.post-thumbnail-container>img").attr("data-src"))
|
||||||
|
|
||||||
|
return newMovieSearchResponse(title, href, TvType.Movie) {
|
||||||
|
this.posterUrl = posterUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
|
val searchResponse = mutableListOf<SearchResponse>()
|
||||||
|
|
||||||
|
for (i in 1..5) {
|
||||||
|
val document = app.get("${mainUrl}/page/$i?s=$query").document
|
||||||
|
|
||||||
|
val results = document.select("article.post").mapNotNull { it.toSearchResult() }
|
||||||
|
|
||||||
|
if (!searchResponse.containsAll(results)) {
|
||||||
|
searchResponse.addAll(results)
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if (results.isEmpty()) break
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun load(url: String): LoadResponse {
|
||||||
|
val document = app.get(url).document
|
||||||
|
|
||||||
|
val title = document.selectFirst("meta[property=og:title]")?.attr("content")?.trim().toString()
|
||||||
|
val poster = fixUrlNull(document.selectFirst("meta[property=og:image]")?.attr("content").toString())
|
||||||
|
val description = document.selectFirst("meta[property=og:description]")?.attr("content")?.trim()
|
||||||
|
|
||||||
|
return newMovieLoadResponse(title, url, TvType.NSFW, url) {
|
||||||
|
this.posterUrl = poster
|
||||||
|
this.plot = description
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun loadLinks(data: String, isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit): Boolean {
|
||||||
|
val document = app.get(data).document
|
||||||
|
|
||||||
|
document.select("div.video-player").map { res ->
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
source = this.name,
|
||||||
|
name = this.name,
|
||||||
|
url = fixUrl(res.selectFirst("meta[itemprop=contentURL]")?.attr("content")?.trim().toString()),
|
||||||
|
referer = data,
|
||||||
|
quality = Qualities.Unknown.value
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue