From 03c1efd6d9b7f610e581c032821a3034b27fa825 Mon Sep 17 00:00:00 2001 From: Saurabh Kaperwan Date: Thu, 21 Nov 2024 12:16:06 +0530 Subject: [PATCH] Remove dead sources --- Cinevood/build.gradle.kts | 27 -- Cinevood/src/main/AndroidManifest.xml | 2 - .../src/main/kotlin/com/cinevood/Cinevood.kt | 296 ------------------ .../kotlin/com/cinevood/CinevoodPlugin.kt | 14 - Deadstream/build.gradle.kts | 25 -- Deadstream/src/main/AndroidManifest.xml | 2 - .../main/kotlin/com/Deadstream/Deadstream.kt | 153 --------- .../com/Deadstream/DeadstreamProvider.kt | 44 --- .../main/kotlin/com/Deadstream/Extractor.kt | 9 - Movies4u/build.gradle.kts | 26 -- Movies4u/src/main/AndroidManifest.xml | 2 - .../src/main/kotlin/com/megix/Movies4u.kt | 13 - .../main/kotlin/com/megix/Movies4uProvider.kt | 291 ----------------- VadaPav/build.gradle.kts | 26 -- VadaPav/src/main/AndroidManifest.xml | 2 - VadaPav/src/main/kotlin/com/megix/VadaPav.kt | 14 - .../main/kotlin/com/megix/VadaPavProvider.kt | 158 ---------- 17 files changed, 1104 deletions(-) delete mode 100644 Cinevood/build.gradle.kts delete mode 100644 Cinevood/src/main/AndroidManifest.xml delete mode 100644 Cinevood/src/main/kotlin/com/cinevood/Cinevood.kt delete mode 100644 Cinevood/src/main/kotlin/com/cinevood/CinevoodPlugin.kt delete mode 100644 Deadstream/build.gradle.kts delete mode 100644 Deadstream/src/main/AndroidManifest.xml delete mode 100644 Deadstream/src/main/kotlin/com/Deadstream/Deadstream.kt delete mode 100644 Deadstream/src/main/kotlin/com/Deadstream/DeadstreamProvider.kt delete mode 100644 Deadstream/src/main/kotlin/com/Deadstream/Extractor.kt delete mode 100644 Movies4u/build.gradle.kts delete mode 100644 Movies4u/src/main/AndroidManifest.xml delete mode 100644 Movies4u/src/main/kotlin/com/megix/Movies4u.kt delete mode 100644 Movies4u/src/main/kotlin/com/megix/Movies4uProvider.kt delete mode 100644 VadaPav/build.gradle.kts delete mode 100644 VadaPav/src/main/AndroidManifest.xml delete mode 100644 VadaPav/src/main/kotlin/com/megix/VadaPav.kt delete mode 100644 VadaPav/src/main/kotlin/com/megix/VadaPavProvider.kt diff --git a/Cinevood/build.gradle.kts b/Cinevood/build.gradle.kts deleted file mode 100644 index 6fd4bf14..00000000 --- a/Cinevood/build.gradle.kts +++ /dev/null @@ -1,27 +0,0 @@ -// use an integer for version numbers -version = 3 - -cloudstream { - description ="Movie and series" - authors = listOf("Dilip") - - /** - * 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 available types here: - // https://recloudstream.github.io/cloudstream/html/app/com.lagradost.cloudstream3/-tv-type/index.html - tvTypes = listOf( - "Movie", - "TvSeries" - ) - language = "hi" - - iconUrl = "https://1cinevood.skin/wp-content/uploads/2020/07/cvlogo.png" -} diff --git a/Cinevood/src/main/AndroidManifest.xml b/Cinevood/src/main/AndroidManifest.xml deleted file mode 100644 index f96ee7ca..00000000 --- a/Cinevood/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/Cinevood/src/main/kotlin/com/cinevood/Cinevood.kt b/Cinevood/src/main/kotlin/com/cinevood/Cinevood.kt deleted file mode 100644 index 61c1c71b..00000000 --- a/Cinevood/src/main/kotlin/com/cinevood/Cinevood.kt +++ /dev/null @@ -1,296 +0,0 @@ -package com.megix -import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.utils.* -import org.jsoup.nodes.Element -import org.jsoup.select.Elements -import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbUrl -import com.lagradost.cloudstream3.LoadResponse.Companion.addActors -import com.google.gson.Gson -import com.lagradost.cloudstream3.utils.AppUtils.parseJson - - -class Cinevood : MainAPI() { // all providers must be an instance of MainAPI - override var mainUrl ="https://1cinevood.cyou" - override var name = "Cinevood" - override val hasMainPage = true - override var lang = "hi" - override val hasDownloadSupport = true - val cinemeta_url = "https://v3-cinemeta.strem.io/meta" - override val supportedTypes = setOf( - TvType.Movie, - TvType.TvSeries, - TvType.AsianDrama, - TvType.Anime - ) - - private fun toResult(post: Element): SearchResponse { - val url = post.select("a").attr("href") - val title = post.select("a").attr("title").toString() - val imageUrl= post.select("img").attr("src") - // Log.d("post", post.toString()) - // val quality = post.select(".video-label").text() - return newMovieSearchResponse(title, url, TvType.Movie) { - this.posterUrl = imageUrl - } - } - override val mainPage = mainPageOf( - "" to "Latest", - "web-series" to "Series", - "bollywood" to "Bollywood", - "hollywood" to "Hollywood" - ) - - override suspend fun getMainPage( - page: Int, - request: MainPageRequest - ): HomePageResponse { - val url =if(page==1) "$mainUrl/${request.data}/" else "$mainUrl/${request.data}/page/$page/" - val document = app.get(url).document - val home = document.select("article.latestpost").mapNotNull { - toResult(it) - } - return newHomePageResponse(request.name, home) - } - - override suspend fun search(query: String): List { - val document = app.get("$mainUrl/?s=$query").document - - return document.select("article.latestpost").mapNotNull { - toResult(it) - } - } - - override suspend fun load(url: String): LoadResponse? { - - val document = app.get(url).document - var title = document.selectFirst("meta[property=og:title]")?.attr("content")?.replace("Download ", "").toString() - val ogTitle = title - var description = document.select("span#summary")?.text().toString().removePrefix("Summary:") - var posterUrl = document.select("meta[property^=og:image]")?.attr("content") - - - - val seasonRegex = """(?i)season\s*\d+""".toRegex() - val imdbUrl = document.selectFirst("a:contains(IMDb)") ?. attr("href") - - val tvtype = if (document.selectFirst("div.thecategory").toString().contains("web-series") && document.select("a[href^=https://hubcloud]").isNullOrEmpty()) { - "series" - } else { - "movie" - } - - - - val responseData = if (!imdbUrl.isNullOrEmpty()) { - val imdbId = imdbUrl.substringAfter("title/").substringBefore("/") - val jsonResponse = app.get("$cinemeta_url/$tvtype/$imdbId.json").text - if(jsonResponse.isNotEmpty() && jsonResponse.startsWith("{")) { - val gson = Gson() - gson.fromJson(jsonResponse, ResponseData::class.java) - } - else { - null - } - } else { - null - } - - var cast: List = emptyList() - var genre: List = emptyList() - var imdbRating: String = "" - var year: String = "" - var background: String? = posterUrl - - if(responseData != null) { - description = responseData.meta?.description ?: description - cast = responseData.meta?.cast ?: emptyList() - title = responseData.meta?.name ?: title - genre = responseData.meta?.genre ?: emptyList() - imdbRating = responseData.meta?.imdbRating ?: "" - year = responseData.meta?.year ?: "" - posterUrl = responseData.meta?.poster ?: posterUrl - background = responseData.meta?.background ?: background - } - - if(tvtype == "series") { - if(title != ogTitle) { - val checkSeason = Regex("""Season\s*\d*1|S\s*\d*1""").find(ogTitle) - if (checkSeason == null) { - val seasonText = Regex("""Season\s*\d+|S\s*\d+""").find(ogTitle)?.value - if(seasonText != null) { - title = title + " " + seasonText.toString() - } - } - } - val tvSeriesEpisodes = mutableListOf() - val episodesMap: MutableMap, List> = mutableMapOf() - var buttons = document.select("a[href^=https://linkbuzz]") - - - buttons.forEach { button -> - val titleElement = button.parent() ?. previousElementSibling() - val mainTitle = titleElement ?. text() ?: "" - val realSeasonRegex = Regex("""(?:Season |S)(\d+)""") - val realSeason = realSeasonRegex.find(mainTitle.toString()) ?. groupValues ?. get(1) ?.toInt() ?: 0 - val episodeLink = button.attr("href") ?: "" - - val doc = app.get(episodeLink).document - var elements = doc.select("a[href^=https://hubcloud]") - if(elements.isEmpty()) { - elements = doc.select("a:matches((?i)(HubCloud|GDFlix))") - } - var e = 1 - - elements.forEach { element -> - if(element.tagName() == "span") { - val titleTag = element.parent() - var hTag = titleTag?.nextElementSibling() - e = Regex("""Ep(\d{2})""").find(element.toString())?.groups?.get(1)?.value ?.toIntOrNull() ?: e - while ( - hTag != null && - ( - hTag.text().contains("HubCloud", ignoreCase = true) || - hTag.text().contains("gdflix", ignoreCase = true) - ) - ) { - val aTag = hTag.selectFirst("a") - val epUrl = aTag?.attr("href").toString() - val key = Pair(realSeason, e) - if (episodesMap.containsKey(key)) { - val currentList = episodesMap[key] ?: emptyList() - val newList = currentList.toMutableList() - newList.add(epUrl) - episodesMap[key] = newList - } else { - episodesMap[key] = mutableListOf(epUrl) - } - hTag = hTag.nextElementSibling() - } - e++ - } - else { - val epUrl = element.attr("href") - val key = Pair(realSeason, e) - if (episodesMap.containsKey(key)) { - val currentList = episodesMap[key] ?: emptyList() - val newList = currentList.toMutableList() - newList.add(epUrl) - episodesMap[key] = newList - } else { - episodesMap[key] = mutableListOf(epUrl) - } - e++ - } - } - e = 1 - } - - for ((key, value) in episodesMap) { - val episodeInfo = responseData?.meta?.videos?.find { it.season == key.first && it.episode == key.second } - val data = value.map { source-> - EpisodeLink( - source - ) - } - tvSeriesEpisodes.add( - newEpisode(data) { - this.name = episodeInfo?.name ?: episodeInfo?.title - this.season = key.first - this.episode = key.second - this.posterUrl = episodeInfo?.thumbnail - this.description = episodeInfo?.overview - } - ) - } - return newTvSeriesLoadResponse(title, url, TvType.TvSeries, tvSeriesEpisodes) { - this.posterUrl = posterUrl - this.plot = description - this.tags = genre - this.rating = imdbRating.toRatingInt() - this.year = year.toIntOrNull() - this.backgroundPosterUrl = background - addActors(cast) - addImdbUrl(imdbUrl) - } - } - else { - val buttons = document.select("a[href^=https://hubcloud]") - val data = buttons.mapNotNull{ button -> - - val source = button.attr("href") - EpisodeLink( - source - ) - - } - return newMovieLoadResponse(title, url, TvType.Movie, data) { - this.posterUrl = posterUrl - this.plot = description - this.tags = genre - this.rating = imdbRating.toRatingInt() - this.year = year.toIntOrNull() - this.backgroundPosterUrl = background - addActors(cast) - addImdbUrl(imdbUrl) - } - } - } - - override suspend fun loadLinks( - data: String, - isCasting: Boolean, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit - ): Boolean { - val sources = parseJson>(data) - sources.amap { - val source = it.source - loadExtractor(source, subtitleCallback, callback) - } - return true - } - - data class Meta( - val id: String?, - val imdb_id: String?, - val type: String?, - val poster: String?, - val logo: String?, - val background: String?, - val moviedb_id: Int?, - val name: String?, - val description: String?, - val genre: List?, - val releaseInfo: String?, - val status: String?, - val runtime: String?, - val cast: List?, - val language: String?, - val country: String?, - val imdbRating: String?, - val slug: String?, - val year: String?, - val videos: List? - ) - - data class EpisodeDetails( - val id: String?, - val name: String?, - val title: String?, - val season: Int?, - val episode: Int?, - val released: String?, - val overview: String?, - val thumbnail: String?, - val moviedb_id: Int? - ) - - data class ResponseData( - val meta: Meta? - ) - - data class EpisodeLink( - val source: String - ) -} - diff --git a/Cinevood/src/main/kotlin/com/cinevood/CinevoodPlugin.kt b/Cinevood/src/main/kotlin/com/cinevood/CinevoodPlugin.kt deleted file mode 100644 index 47506b71..00000000 --- a/Cinevood/src/main/kotlin/com/cinevood/CinevoodPlugin.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.megix - -import android.content.Context -import com.lagradost.cloudstream3.plugins.CloudstreamPlugin -import com.lagradost.cloudstream3.plugins.Plugin - -@CloudstreamPlugin -class CinevoodPlugin : Plugin() { - override fun load(context: Context) { - // All providers should be added in this manner. Please don't edit the providers list directly. - - registerMainAPI(Cinevood()) - } -} diff --git a/Deadstream/build.gradle.kts b/Deadstream/build.gradle.kts deleted file mode 100644 index 92961256..00000000 --- a/Deadstream/build.gradle.kts +++ /dev/null @@ -1,25 +0,0 @@ -// use an integer for version numbers -version = 4 - -cloudstream { - // All of these properties are optional, you can safely remove them - - description = "Hindi Dubbed & Subbed Anime" - language = "hi" - authors = listOf("megix") - - /** - * 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("Movie,Anime,Cartoon") - iconUrl = "https://deadstream.xyz/images/logo.png?v=0.1" -} diff --git a/Deadstream/src/main/AndroidManifest.xml b/Deadstream/src/main/AndroidManifest.xml deleted file mode 100644 index 1863f02a..00000000 --- a/Deadstream/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/Deadstream/src/main/kotlin/com/Deadstream/Deadstream.kt b/Deadstream/src/main/kotlin/com/Deadstream/Deadstream.kt deleted file mode 100644 index 395868fb..00000000 --- a/Deadstream/src/main/kotlin/com/Deadstream/Deadstream.kt +++ /dev/null @@ -1,153 +0,0 @@ -package com.Deadstream - -import org.jsoup.nodes.Element -import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.utils.* - -class Deadstream : MainAPI() { - override var mainUrl = "https://deadstream.xyz" - override var name = "Deadstream" - override val hasMainPage = true - override var lang = "hi" - override val hasDownloadSupport = true - override val supportedTypes = setOf(TvType.Movie, TvType.Anime) - - override val mainPage = mainPageOf( - "$mainUrl/recently-updated" to "Latest", - "$mainUrl/most-popular" to "Most Popular", - "$mainUrl/tv" to "Series", - "$mainUrl/movie" to "Movies", - ) - - override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse { - val document = app.get(request.data + "?page=$page", timeout = 30L).document - val home = document.select("div.flw-item").mapNotNull { it.toSearchResult() } - return newHomePageResponse( - list = HomePageList( - name = request.name, - list = home, - isHorizontalImages = false - ), - hasNext = true - ) - } - - private fun Element.toSearchResult(): SearchResponse? { - val title = this.selectFirst("a")?.attr("title") ?: return null - val href = fixUrl(this.selectFirst("a")?.attr("href") ?: return null) - val posterUrl = fixUrl(this.selectFirst("img")?.attr("data-src") ?: return null) - return newMovieSearchResponse(title, href, TvType.Movie) { - this.posterUrl = posterUrl - } - } - - override suspend fun search(query: String): List { - val searchResponse = mutableListOf() - val document = app.get("${mainUrl}/search?keyword=${query}", timeout = 30L).document - val results = document.select("div.flw-item").mapNotNull { it.toSearchResult() } - searchResponse.addAll(results) - return searchResponse - } - - override suspend fun load(url: String): LoadResponse? { - val document = app.get(url, timeout = 30L).document - val title = document.selectFirst("h2.film-name")?.text() ?: return null - val div = document.selectFirst("div[style*=background-image]") ?: return null - val posterUrl = div.attr("style").substringAfter("url(").substringBefore(")") - val plot = document.selectFirst("div.item-title.w-hide")?.text() ?: "" - val type = if (document.selectFirst("div.film-stats")?.text()?.contains("MOVIE") == true) TvType.Movie else TvType.TvSeries - - if (type == TvType.TvSeries) { - val tvSeriesEpisodes = mutableListOf() - var seasonNum = 1 - val seasonList = mutableListOf>() - - document.select("a.btn-play").mapNotNull { - val seasonText = it.text() - seasonList.add(Pair(seasonText, seasonNum)) - val href = fixUrl(it.attr("href")) - val doc = app.get(href, timeout = 30L).document - - doc.selectFirst("div.ss-list")?.select("a")?.mapNotNull { episode -> - val epName = episode.attr("title") - val epNum = episode.attr("data-number").toIntOrNull() ?: 0 - val epUrl = fixUrl(episode.attr("href")) - tvSeriesEpisodes.add( - newEpisode(epUrl) { - name = epName - season = seasonNum - this.episode = epNum - } - ) - } - seasonNum++ - } - - return newTvSeriesLoadResponse(title, url, TvType.Anime, tvSeriesEpisodes) { - this.posterUrl = posterUrl - this.plot = plot - this.seasonNames = seasonList.map { (name, int) -> SeasonData(int, name) } - } - - } else { - val movieLink = fixUrl(document.selectFirst("a.btn-play")?.attr("href") ?: return null) - return newMovieLoadResponse(title, url, TvType.Movie, movieLink) { - this.posterUrl = posterUrl - this.plot = plot - } - } - } - - override suspend fun loadLinks(data: String, isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit): Boolean { - val document = app.get(data, timeout = 30L).document - val quality = document.selectFirst("div#servers-content") - - quality?.select("div.item")?.amap { - val id = it.attr("data-embed") - val qualityText = it.text() - val url = "https://deaddrive.xyz/embed/$id" - val doc = app.get(url, timeout = 30L).document - doc.selectFirst("ul.list-server-items")?.select("li")?.amap { source -> - if (!source.attr("data-video").contains("short.ink")) { - val link = source.attr("data-video").toString() - loadCustomExtractor(link, "https://deaddrive.xyz/", subtitleCallback, callback, getIndexQuality(qualityText)) - } - } - } - return true - } - - private fun getIndexQuality(str: String?): Int { - return Regex("(\\d{3,4})[pP]").find(str ?: "") ?. groupValues ?. getOrNull(1) ?. toIntOrNull() - ?: Qualities.Unknown.value - } - - private suspend fun loadCustomExtractor( - url: String, - referer: String? = null, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit, - quality: Int = Qualities.Unknown.value, - ){ - val wantedNames = listOf("Chillx", "Bestx", "Boosterx", "Vectorx", "Boltx", "Beastx", "Watchx") - loadExtractor(url, referer ,subtitleCallback) { link -> - if( - link.quality == Qualities.Unknown.value || - wantedNames.any { link.name.contains(it) } - ) { - callback.invoke ( - ExtractorLink ( - link.source, - link.name, - link.url, - link.referer, - quality, - link.type, - link.headers, - link.extractorData - ) - ) - } - } - } -} diff --git a/Deadstream/src/main/kotlin/com/Deadstream/DeadstreamProvider.kt b/Deadstream/src/main/kotlin/com/Deadstream/DeadstreamProvider.kt deleted file mode 100644 index f923aa1e..00000000 --- a/Deadstream/src/main/kotlin/com/Deadstream/DeadstreamProvider.kt +++ /dev/null @@ -1,44 +0,0 @@ -package com.Deadstream - -import com.lagradost.cloudstream3.plugins.CloudstreamPlugin -import com.lagradost.cloudstream3.plugins.Plugin -import android.content.Context -import com.lagradost.cloudstream3.extractors.VidHidePro -import com.lagradost.cloudstream3.extractors.Chillx -import com.lagradost.cloudstream3.extractors.StreamWishExtractor -import com.lagradost.cloudstream3.extractors.Voe - -@CloudstreamPlugin -class DeadstreamProvider: Plugin() { - private fun classExist(className: String) : Boolean { - try { - Class.forName(className, false, ClassLoader.getSystemClassLoader()) - } catch (e: ClassNotFoundException) { - return false - } - - return true - } - - override fun load(context: Context) { - registerMainAPI(Deadstream()) - registerExtractorAPI(Chillx()) - registerExtractorAPI(Voe()) - registerExtractorAPI(StreamWishExtractor()) - registerExtractorAPI(MyFileMoon()) - /* - Check if class exists before load - v.4.4.0 released 20240725 - Class added on 20240819 - - 7bdf1461 (Added VidHidePro Extractor (#1286), 2024-08-19) - library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/VidHidePro.kt - - */ - if (classExist("com.lagradost.cloudstream3.extractors.VidHidePro")) { - registerExtractorAPI(VidHidePro()) - } - - //registerExtractorAPI(AbyssCdn()) - } -} diff --git a/Deadstream/src/main/kotlin/com/Deadstream/Extractor.kt b/Deadstream/src/main/kotlin/com/Deadstream/Extractor.kt deleted file mode 100644 index 056d9655..00000000 --- a/Deadstream/src/main/kotlin/com/Deadstream/Extractor.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.Deadstream - -import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.utils.* -import com.lagradost.cloudstream3.extractors.Filesim - -class MyFileMoon : Filesim() { - override var mainUrl = "https://filemoon.nl" -} diff --git a/Movies4u/build.gradle.kts b/Movies4u/build.gradle.kts deleted file mode 100644 index e8d21bb2..00000000 --- a/Movies4u/build.gradle.kts +++ /dev/null @@ -1,26 +0,0 @@ -version = 9 - -cloudstream { - language = "hi" - // All of these properties are optional, you can safely remove them - - description = "High Quality Movies and TV Shows" - authors = listOf("megix") - - /** - * Status int as the following: - * 0: Down - * 1: Ok - * 2: Slow - * 3: Beta only - * */ - status = 1 // will be 3 if unspecified - tvTypes = listOf( - "TvSeries", - "Movie", - "AsianDrama", - "Anime" - ) - - iconUrl = "https://www.movies4u.com.vc/templates/favicon.jpg" -} diff --git a/Movies4u/src/main/AndroidManifest.xml b/Movies4u/src/main/AndroidManifest.xml deleted file mode 100644 index f96ee7ca..00000000 --- a/Movies4u/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/Movies4u/src/main/kotlin/com/megix/Movies4u.kt b/Movies4u/src/main/kotlin/com/megix/Movies4u.kt deleted file mode 100644 index 50edbf64..00000000 --- a/Movies4u/src/main/kotlin/com/megix/Movies4u.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.megix - -import com.lagradost.cloudstream3.plugins.CloudstreamPlugin -import com.lagradost.cloudstream3.plugins.Plugin -import android.content.Context - -@CloudstreamPlugin -class Movies4u: Plugin() { - override fun load(context: Context) { - // All providers should be added in this manner. Please don't edit the providers list directly. - registerMainAPI(Movies4uProvider()) - } -} diff --git a/Movies4u/src/main/kotlin/com/megix/Movies4uProvider.kt b/Movies4u/src/main/kotlin/com/megix/Movies4uProvider.kt deleted file mode 100644 index 2e5103b6..00000000 --- a/Movies4u/src/main/kotlin/com/megix/Movies4uProvider.kt +++ /dev/null @@ -1,291 +0,0 @@ -package com.megix - -import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.utils.* -import org.jsoup.nodes.Element -import org.jsoup.select.Elements -import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbUrl -import com.lagradost.cloudstream3.LoadResponse.Companion.addActors -import com.google.gson.Gson -import com.lagradost.cloudstream3.utils.AppUtils.parseJson -import okhttp3.FormBody - -class Movies4uProvider : MainAPI() { // all providers must be an instance of MainAPI - override var mainUrl = "https://www.movies4u.com.vc" - override var name = "Movies4u" - override val hasMainPage = true - override var lang = "hi" - override val hasDownloadSupport = true - val cinemeta_url = "https://v3-cinemeta.strem.io/meta" - override val supportedTypes = setOf( - TvType.Movie, - TvType.TvSeries, - TvType.AsianDrama, - TvType.Anime - ) - - override val mainPage = mainPageOf( - "$mainUrl/page/" to "Home", - "$mainUrl/category/bollywood/page/" to "Bollywood", - "$mainUrl/category/web-series/page/" to "Web Series", - "$mainUrl/category/anime/page/" to "Anime" - ) - - override suspend fun getMainPage( - page: Int, - request: MainPageRequest - ): HomePageResponse { - val document = app.get(request.data + page).document - val home = document.select("article.post").mapNotNull { - it.toSearchResult() - } - return newHomePageResponse(request.name, home) - } - - private fun Element.toSearchResult(): SearchResponse? { - val title = this.selectFirst("h3 > a")?.text().toString() - val href = fixUrl(this.selectFirst("figure > a")?.attr("href").toString()) - val posterUrl = this.selectFirst("figure > a > img")?.attr("src").toString() - val quality = getQualityFromString(this.selectFirst("figure > a > span.video-label")?.text().toString()) - - return newMovieSearchResponse(title, href, TvType.Movie) { - this.posterUrl = posterUrl - this.quality = quality - } - } - - override suspend fun search(query: String): List { - val searchResponse = mutableListOf() - - for (i in 1..5) { - val document = app.get("$mainUrl/search.php?q=$query&page=$i/").document - - val results = document.select("article.post").mapNotNull { it.toSearchResult() } - - if (results.isEmpty()) { - break - } - searchResponse.addAll(results) - } - - return searchResponse - } - - override suspend fun load(url: String): LoadResponse? { - val document = app.get(url).document - var title = document.selectFirst("title")?.text().toString() - var posterUrl = document.selectFirst("meta[property=og:image]")?.attr("content").toString() - - val checkType = document.selectFirst("h3 > strong")?.text().toString() - val imdbUrl = document.selectFirst("strong > a:matches((?i)(IMDb))")?.attr("href") - var description = "" - - var tvtype = if (checkType.contains("Movie")) { - "movie" - } else { - "series" - } - - val responseData = if (!imdbUrl.isNullOrEmpty()) { - val imdbId = imdbUrl.substringAfter("title/").substringBefore("/") - val jsonResponse = app.get("$cinemeta_url/$tvtype/$imdbId.json").text - if(jsonResponse.isNotEmpty() && jsonResponse.startsWith("{")) { - val gson = Gson() - gson.fromJson(jsonResponse, ResponseData::class.java) - } - else { - null - } - } else { - null - } - - var cast: List = emptyList() - var genre: List = emptyList() - var imdbRating: String = "" - var year: String = "" - var background: String = posterUrl - - if(responseData != null) { - description = responseData.meta?.description ?: description - cast = responseData.meta?.cast ?: emptyList() - title = responseData.meta?.name ?: title - genre = responseData.meta?.genre ?: emptyList() - imdbRating = responseData.meta?.imdbRating ?: "" - year = responseData.meta?.year ?: "" - posterUrl = responseData.meta?.poster ?: posterUrl - background = responseData.meta?.background ?: background - } - - if(tvtype == "series") { - val tvSeriesEpisodes = mutableListOf() - val episodesMap: MutableMap, List> = mutableMapOf() - var buttons = document.select("a:has(button.btn.btn-sm.btn-outline:matches((?i)(V-Cloud)))") - if(buttons.isEmpty()) { - buttons = document.select("a:has(button.dwd-button)") - } - buttons.forEach { button -> - val titleElement = button.parent()?.previousElementSibling()?.text() - val realSeasonRegex = Regex("""(?:Season |S)(\d+)""") - val realSeason = realSeasonRegex.find(titleElement.toString()) ?. groupValues ?. get(1) ?.toInt() ?: 0 - val doc = app.get(button.attr("href")).document - val episodes = doc.select("button.btn.btn-sm.btn-outline:matches((?i)(VCloud))") - var e = 1 - - episodes.forEach { element -> - val epUrl = element.parent()?.attr("href") - if(epUrl != null) { - val key = Pair(realSeason, e) - if (episodesMap.containsKey(key)) { - val currentList = episodesMap[key] ?: emptyList() - val newList = currentList.toMutableList() - newList.add(epUrl) - episodesMap[key] = newList - } else { - episodesMap[key] = mutableListOf(epUrl) - } - e++ - } - } - e = 1 - } - - for ((key, value) in episodesMap) { - val episodeInfo = responseData?.meta?.videos?.find { it.season == key.first && it.episode == key.second } - val data = value.map { source-> - EpisodeLink( - source - ) - } - tvSeriesEpisodes.add( - newEpisode(data) { - this.name = episodeInfo?.name ?: episodeInfo?.title - this.season = key.first - this.episode = key.second - this.posterUrl = episodeInfo?.thumbnail - this.description = episodeInfo?.overview - } - ) - } - return newTvSeriesLoadResponse(title, url, TvType.TvSeries, tvSeriesEpisodes) { - this.posterUrl = posterUrl - this.plot = description - this.tags = genre - this.rating = imdbRating.toRatingInt() - this.year = year.toIntOrNull() - this.backgroundPosterUrl = background - addActors(cast) - addImdbUrl(imdbUrl) - } - } - else { - val data = document.select("a:has(button.dwd-button)").mapNotNull { - val doc = app.get(it.attr("href")).document - val link = doc.selectFirst("p > a:matches((?i)(VCloud))")?.attr("href") ?: "" - EpisodeLink( - link - ) - } - - return newMovieLoadResponse(title, url, TvType.Movie, data) { - this.posterUrl = posterUrl - this.plot = description - this.tags = genre - this.rating = imdbRating.toRatingInt() - this.year = year.toIntOrNull() - this.backgroundPosterUrl = background - addActors(cast) - addImdbUrl(imdbUrl) - } - } - } - - private fun getIndexQuality(str: String?): Int { - return Regex("(\\d{3,4})[pP]").find(str ?: "") ?. groupValues ?. getOrNull(1) ?. toIntOrNull() - ?: Qualities.Unknown.value - } - - override suspend fun loadLinks( - data: String, - isCasting: Boolean, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit - ): Boolean { - val sources = parseJson>(data) - sources.mapNotNull { - val source = it.source - val doc = app.get(source).document - val quality = doc.selectFirst("tbody > tr > td:matches((?i)(Name:))")?.nextElementSibling()?.text() ?: "" - val size = doc.selectFirst("tbody > tr > td:matches((?i)(Size))")?.nextElementSibling()?.text() ?: "" - val value = doc.selectFirst("form > input")?.attr("value") ?: "" - callback.invoke( - ExtractorLink( - "Movies4u", - "Movies4u $size", - value, - "", - getIndexQuality(quality), - ) - ) - val body = FormBody.Builder().add("hash", value).build() - val doc2 = app.post(source, requestBody = body).document - doc2.select("a:matches((?i)(Download Server))").mapNotNull { aTag-> - val link = aTag.attr("href") - callback.invoke( - ExtractorLink( - "Movies4u", - "Movies4u $size", - link, - "", - getIndexQuality(quality), - ) - ) - } - } - return true - } - - data class Meta( - val id: String?, - val imdb_id: String?, - val type: String?, - val poster: String?, - val logo: String?, - val background: String?, - val moviedb_id: Int?, - val name: String?, - val description: String?, - val genre: List?, - val releaseInfo: String?, - val status: String?, - val runtime: String?, - val cast: List?, - val language: String?, - val country: String?, - val imdbRating: String?, - val slug: String?, - val year: String?, - val videos: List? - ) - - data class EpisodeDetails( - val id: String?, - val name: String?, - val title: String?, - val season: Int?, - val episode: Int?, - val released: String?, - val overview: String?, - val thumbnail: String?, - val moviedb_id: Int? - ) - - data class ResponseData( - val meta: Meta? - ) - - data class EpisodeLink( - val source: String - ) -} - diff --git a/VadaPav/build.gradle.kts b/VadaPav/build.gradle.kts deleted file mode 100644 index 20499d67..00000000 --- a/VadaPav/build.gradle.kts +++ /dev/null @@ -1,26 +0,0 @@ -version = 7 - -cloudstream { - language = "en" - // All of these properties are optional, you can safely remove them - - description = "Contains Movies, TV Series and Anime upto 4K" - authors = listOf("megix") - - /** - * Status int as the following: - * 0: Down - * 1: Ok - * 2: Slow - * 3: Beta only - * */ - status = 1 // will be 3 if unspecified - tvTypes = listOf( - "Movie", - "TvSeries", - "Anime", - "AsianDrama", - ) - - iconUrl = "https://vadapav.mov/assets/favicon-32x32.png" -} diff --git a/VadaPav/src/main/AndroidManifest.xml b/VadaPav/src/main/AndroidManifest.xml deleted file mode 100644 index f96ee7ca..00000000 --- a/VadaPav/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/VadaPav/src/main/kotlin/com/megix/VadaPav.kt b/VadaPav/src/main/kotlin/com/megix/VadaPav.kt deleted file mode 100644 index ed5f90af..00000000 --- a/VadaPav/src/main/kotlin/com/megix/VadaPav.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.megix - -import com.lagradost.cloudstream3.plugins.CloudstreamPlugin -import com.lagradost.cloudstream3.plugins.Plugin -import android.content.Context - - -@CloudstreamPlugin -class VadaPav: Plugin() { - override fun load(context: Context) { - // All providers should be added in this manner. Please don't edit the providers list directly. - registerMainAPI(VadaPavProvider()) - } -} diff --git a/VadaPav/src/main/kotlin/com/megix/VadaPavProvider.kt b/VadaPav/src/main/kotlin/com/megix/VadaPavProvider.kt deleted file mode 100644 index 6b69f9e4..00000000 --- a/VadaPav/src/main/kotlin/com/megix/VadaPavProvider.kt +++ /dev/null @@ -1,158 +0,0 @@ -package com.megix - -import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.utils.* -import org.jsoup.nodes.Element -import org.jsoup.nodes.Document -import org.jsoup.select.Elements -import org.jsoup.Jsoup - -class VadaPavProvider : MainAPI() { // all providers must be an instance of MainAPI - override var mainUrl = "https://vadapav.mov" - override var name = "VadaPav" - override val hasMainPage = true - override var lang = "en" - override val hasDownloadSupport = true - private val mirrors = listOf( - "https://vadapav.mov", - "https://dl1.vadapav.mov", - "https://dl2.vadapav.mov", - "https://dl3.vadapav.mov", - ) - override val supportedTypes = setOf( - TvType.Movie, - TvType.TvSeries, - TvType.Anime, - ) - - override val mainPage = mainPageOf( - "f36be06f-8edd-4173-99df-77bc4c7c2626" to "Movies", - "28dc7aeb-902b-4824-8be2-fa1e4f20383c" to "TV", - "acb8953f-8a6a-480e-938f-2796213aa261" to "Bollywood Movies", - "53e89fa0-5c79-47d9-a50c-ed7fd4b623c8" to "Bollywood TV", - "accac8e8-f794-47fd-b40b-8486bc8ab531" to "Hollywood Movies Hindi Dubbed", - "72be5227-4a91-4939-96b3-dc77a9563f55" to "Hollywood Series Hindi Dubbed", - "716da8ac-ed44-4fd4-aedc-eacefd00eeec" to "Recent", - "60ac9f3f-9a3b-417a-abe7-dac7d20e38f4" to "Airing Anime", - "54bc9bc8-3496-4091-8174-544de130ce21" to "South Hindi Dubbed" - ) - - override suspend fun getMainPage( - page: Int, - request: MainPageRequest - ): HomePageResponse { - val document = app.get("$mainUrl/${request.data}").document - val home = document.select("div.directory > ul > li > div > a").filter { element -> !element.text().contains("Parent Directory", true) }.mapNotNull { - it.toSearchResult() - } - return newHomePageResponse(request.name, home) - } - - private fun Element.toSearchResult(): SearchResponse? { - val title = this.text() ?: "" - val link = fixUrl(this.attr("href")) - - return newMovieSearchResponse(title, link, TvType.Movie) { - } - } - - override suspend fun search(query: String): List { - val searchResponse = mutableListOf() - val document = app.get("$mainUrl/s/$query").document - - val results = document.select("div.directory > ul > li > div > a").filter { element -> !element.text().contains("Parent Directory", true) }.mapNotNull { it.toSearchResult() } - - searchResponse.addAll(results) - - return searchResponse - } - - data class MutableInt(var value: Int) - - private suspend fun traverse(dTags: List ,tvSeriesEpisodes: MutableList, seasonList: MutableList>, mutableSeasonNum: MutableInt) { - for(dTag in dTags) { - val document = app.get(fixUrl(dTag.attr("href"))).document - val innerDTags = document.select("div.directory > ul > li > div > a.directory-entry").filter { element -> !element.text().contains("Parent Directory", true) } - val innerFTags = document.select("div.directory > ul > li > div > a.file-entry") - - if(innerFTags.isNotEmpty()) { - val span = document.select("div > span") - val lastSpan = span.takeIf { it.isNotEmpty() } ?. lastOrNull() - val title = lastSpan ?. text() ?: "" - seasonList.add("$title" to mutableSeasonNum.value) - val episodes = innerFTags.amap { tag -> - newEpisode(tag.attr("href")){ - name = tag.text() - season = mutableSeasonNum.value - episode = innerFTags.indexOf(tag) + 1 - } - } - tvSeriesEpisodes.addAll(episodes) - mutableSeasonNum.value++ - } - - if(innerDTags.isNotEmpty()) { - traverse(innerDTags, tvSeriesEpisodes, seasonList, mutableSeasonNum) - } - } - } - - override suspend fun load(url: String): LoadResponse? { - val document = app.get(url).document - val span = document.select("div > span") - val lastSpan = span.takeIf { it.isNotEmpty() } ?. lastOrNull() - val title = lastSpan ?. text() ?: "" - var seasonNum = 1 - val tvSeriesEpisodes = mutableListOf() - val dTags = document.select("div.directory > ul > li > div > a.directory-entry").filter { element -> !element.text().contains("Parent Directory", true) } - val fTags = document.select("div.directory > ul > li > div > a.file-entry") - val seasonList = mutableListOf>() - val mutableSeasonNum = MutableInt(seasonNum) - - if(fTags.isNotEmpty()) { - val innerSpan = document.select("div > span") - val lastInnerSpan = innerSpan.takeIf { it.isNotEmpty() } ?. lastOrNull() - val titleText = lastInnerSpan ?. text() ?: "" - seasonList.add("$titleText" to mutableSeasonNum.value) - val episodes = fTags.amap { tag -> - newEpisode(tag.attr("href")){ - name = tag.text() - season = mutableSeasonNum.value - episode = fTags.indexOf(tag) + 1 - } - } - tvSeriesEpisodes.addAll(episodes) - mutableSeasonNum.value++ - } - - if(dTags.isNotEmpty()) { - traverse(dTags, tvSeriesEpisodes, seasonList, mutableSeasonNum) - } - - return newTvSeriesLoadResponse(title, url, TvType.TvSeries, tvSeriesEpisodes) { - this.seasonNames = seasonList.map {(name, int) -> SeasonData(int, name)} - } - } - - override suspend fun loadLinks( - data: String, - isCasting: Boolean, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit - ): Boolean { - var link = data.replace("$mainUrl", "") - for((index, mirror) in mirrors.withIndex()) { - callback.invoke( - ExtractorLink( - name+ " ${index+1}", - name+" ${index+1}", - mirror + link, - referer = "", - quality = Qualities.Unknown.value, - ) - ) - } - return true - } - -}