diff --git a/UncutMaza/build.gradle.kts b/UncutMaza/build.gradle.kts new file mode 100644 index 0000000..996acae --- /dev/null +++ b/UncutMaza/build.gradle.kts @@ -0,0 +1,28 @@ +// use an integer for version numbers +version = 5 + + +cloudstream { + // All of these properties are optional, you can safely remove them + + description = "Uncutmaza" + authors = listOf("Coxju") + + /** + * Status int as the following: + * 0: Down + * 1: Ok + * 2: Slow + * 3: Beta only + * */ + status = 1 // will be 3 if unspecified + + // List of video source types. Users are able to filter for extensions in a given category. + // You can find a list of avaliable types here: + // https://recloudstream.github.io/cloudstream/html/app/com.lagradost.cloudstream3/-tv-type/index.html + tvTypes = listOf("NSFW") + + iconUrl = "https://www.google.com/s2/favicons?domain=uncutmaza.com&sz=%size%" + + language = "en" +} diff --git a/UncutMaza/src/main/AndroidManifest.xml b/UncutMaza/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0862a59 --- /dev/null +++ b/UncutMaza/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/UncutMaza/src/main/kotlin/com/KillerDogeEmpire/UncutMaza.kt b/UncutMaza/src/main/kotlin/com/KillerDogeEmpire/UncutMaza.kt new file mode 100644 index 0000000..0d8e859 --- /dev/null +++ b/UncutMaza/src/main/kotlin/com/KillerDogeEmpire/UncutMaza.kt @@ -0,0 +1,118 @@ +package com.KillerDogeEmpire + +import com.lagradost.cloudstream3.HomePageList +import com.lagradost.cloudstream3.HomePageResponse +import com.lagradost.cloudstream3.LoadResponse +import com.lagradost.cloudstream3.MainAPI +import com.lagradost.cloudstream3.MainPageRequest +import com.lagradost.cloudstream3.SearchResponse +import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.TvType +import com.lagradost.cloudstream3.VPNStatus +import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.fixTitle +import com.lagradost.cloudstream3.fixUrl +import com.lagradost.cloudstream3.fixUrlNull +import com.lagradost.cloudstream3.mainPageOf +import com.lagradost.cloudstream3.newHomePageResponse +import com.lagradost.cloudstream3.newMovieLoadResponse +import com.lagradost.cloudstream3.newMovieSearchResponse +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.Qualities +import org.jsoup.nodes.Element + +class UncutMaza : MainAPI() { + override var mainUrl = "https://uncutmaza.com" + override var name = "Uncutmaza" + override val hasMainPage = true + override val hasDownloadSupport = true + override val vpnStatus = VPNStatus.MightBeNeeded + override val supportedTypes = setOf(TvType.NSFW) + + 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 { + val searchResponse = mutableListOf() + 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( + this.name, this.name, fixUrl( + res.selectFirst("meta[itemprop=contentURL]")?.attr("content")?.trim() + .toString() + ), referer = data, quality = Qualities.Unknown.value + ) + ) + } + + return true + } + +} \ No newline at end of file diff --git a/UncutMaza/src/main/kotlin/com/KillerDogeEmpire/UncutMazaProvider.kt b/UncutMaza/src/main/kotlin/com/KillerDogeEmpire/UncutMazaProvider.kt new file mode 100644 index 0000000..bb95eba --- /dev/null +++ b/UncutMaza/src/main/kotlin/com/KillerDogeEmpire/UncutMazaProvider.kt @@ -0,0 +1,14 @@ +package com.KillerDogeEmpire + +import com.lagradost.cloudstream3.plugins.CloudstreamPlugin +import com.lagradost.cloudstream3.plugins.Plugin +import android.content.Context +import com.KillerDogeEmpire.UncutMaza + +@CloudstreamPlugin +class UncutMazaProvider: Plugin() { + override fun load(context: Context) { + // All providers should be added in this manner. Please don't edit the providers list directly. + registerMainAPI(UncutMaza()) + } +} \ No newline at end of file