update and refactor stuff (#516)

This commit is contained in:
IndusAryan 2024-01-14 17:48:06 +05:30 committed by GitHub
parent 832656852a
commit bb6ca96489
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 27 additions and 57 deletions

View file

@ -1,11 +1,8 @@
version = 1 version = 2
cloudstream { cloudstream {
language = "hi" language = "hi"
// All of these properties are optional, you can safely remove them description = "SKIP ADS on the SITE every 24 hours to Play, has Hindi Dubbed Cartoons"
description = "YOU HAVE SKIP ADS on the SITE each 24 hours, Hindi dubbed cartoons"
authors = listOf("anon") authors = listOf("anon")
/** /**

View file

@ -3,19 +3,11 @@ package com.anon
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context import android.content.Context
// import com.lagradost.cloudstream3.utils.ExtractorApi
// import com.lagradost.cloudstream3.utils.extractorApis
@CloudstreamPlugin @CloudstreamPlugin
class AnimeDekhoPlugin: Plugin() { class AnimeDekhoPlugin: Plugin() {
override fun load(context: Context) { override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(AnimeDekhoProvider()) registerMainAPI(AnimeDekhoProvider())
//addExtractor(MultiQualityXYZ()) //addExtractor(MultiQualityXYZ())
} }
// private fun addExtractor(element: ExtractorApi) {
// element.sourcePlugin = __filename
// extractorApis.add(0, element)
// }
} }

View file

@ -28,18 +28,17 @@ import okhttp3.RequestBody.Companion.toRequestBody
import com.lagradost.cloudstream3.extractors.helper.AesHelper.cryptoAESHandler import com.lagradost.cloudstream3.extractors.helper.AesHelper.cryptoAESHandler
class AnimeDekhoProvider : MainAPI() {
class AnimeDekhoProvider : MainAPI() { // all providers must be an instance of MainAPI override var mainUrl = "https://animedekho.com"
override var mainUrl = "https://animedekho.com/"
override var name = "Anime Dekho" override var name = "Anime Dekho"
override val hasMainPage = true override val hasMainPage = true
override var lang = "hi" override var lang = "hi"
override val hasDownloadSupport = true override val hasDownloadSupport = true
override val supportedTypes = setOf( override val supportedTypes = setOf(
TvType.TvSeries, TvType.Cartoon,
TvType.Anime,
TvType.AnimeMovie,
TvType.Movie TvType.Movie
) )
@ -53,15 +52,12 @@ class AnimeDekhoProvider : MainAPI() { // all providers must be an instance of M
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse { override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val link = "$mainUrl${request.data}" val link = "$mainUrl${request.data}"
val document = app.get(link).document val document = app.get(link).document
//Log.d("TAGNAME", "$document")
val home = document.select("article").mapNotNull { val home = document.select("article").mapNotNull {
it.toSearchResult() it.toSearchResult()
} }
return newHomePageResponse(request.name, home) return newHomePageResponse(request.name, home)
} }
private fun Element.toSearchResult(): AnimeSearchResponse? { private fun Element.toSearchResult(): AnimeSearchResponse? {
//val href = fixUrl(this.selectFirst("a")?.attr("href") ?: return null) //val href = fixUrl(this.selectFirst("a")?.attr("href") ?: return null)
val href = this.selectFirst("a.lnk-blk")?.attr("href") ?: "null" val href = this.selectFirst("a.lnk-blk")?.attr("href") ?: "null"
@ -128,7 +124,6 @@ class AnimeDekhoProvider : MainAPI() { // all providers must be an instance of M
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
var vidlink = "" var vidlink = ""
if(data.contains("https://vidxstream.xyz")){ if(data.contains("https://vidxstream.xyz")){
@ -142,7 +137,6 @@ class AnimeDekhoProvider : MainAPI() { // all providers must be an instance of M
var term = Regex("""\bterm-(\d+)\b""").find(name)?.value!!?.replace("term-","") var term = Regex("""\bterm-(\d+)\b""").find(name)?.value!!?.replace("term-","")
vidlink = app.get("https://animedekho.com/?trembed=0&trid="+term) vidlink = app.get("https://animedekho.com/?trembed=0&trid="+term)
.document?.selectFirst("iframe")?.attr("src") ?: "null" .document?.selectFirst("iframe")?.attr("src") ?: "null"
} }
@ -151,7 +145,6 @@ class AnimeDekhoProvider : MainAPI() { // all providers must be an instance of M
val body = app.get(vidlink).text val body = app.get(vidlink).text
val master = Regex("""JScript[\w+]?\s*=\s*'([^']+)""").find(body)!!.groupValues?.get(1) val master = Regex("""JScript[\w+]?\s*=\s*'([^']+)""").find(body)!!.groupValues?.get(1)
val decrypt = cryptoAESHandler(master ?: return false, "4MmH9EsZrq0WEekn".toByteArray(), false)?.replace("\\", "") ?: "ERROR" val decrypt = cryptoAESHandler(master ?: return false, "4MmH9EsZrq0WEekn".toByteArray(), false)?.replace("\\", "") ?: "ERROR"
@ -172,27 +165,17 @@ class AnimeDekhoProvider : MainAPI() { // all providers must be an instance of M
"user-agent" to "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0", "user-agent" to "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0",
) )
callback.invoke( callback.invoke(ExtractorLink
ExtractorLink( (
source = "Toon", source = "Toon",
name = "Toon", name = "Toon",
url = vidfinal!!, url = vidfinal!!,
referer = "https://vidxstream.xyz/", referer = "https://vidxstream.xyz/",
quality = Qualities.Unknown.value, quality = Qualities.Unknown.value,
isM3u8 = true, isM3u8 = true,
headers = headers, headers = headers,
)
) )
)
return true return true
} }
} }

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 56 version = 57
cloudstream { cloudstream {

View file

@ -18,6 +18,4 @@ class Animesaga : Movierulzhd() {
"tvshows" to "TV-Shows", "tvshows" to "TV-Shows",
"genre/hindi-dub" to "Hindi Dub", "genre/hindi-dub" to "Hindi Dub",
) )
} }

View file

@ -12,14 +12,14 @@ import org.jsoup.Jsoup
class Hdmovie2 : Movierulzhd() { class Hdmovie2 : Movierulzhd() {
override var mainUrl = "https://hdmovie2.foo" override var mainUrl = "https://hdmovie2.ist"
override var name = "Hdmovie2" override var name = "Hdmovie2"
override val mainPage = mainPageOf( override val mainPage = mainPageOf(
"trending" to "Trending", "trending" to "Trending",
"movies" to "Movies", "movies" to "Movies",
"genre/tv-series" to "TV-Series", "genre/tv-series" to "TV Shows",
"genre/netflix" to "Netflix", "genre/netflix" to "Netflix",
"genre/zee5-tv-series" to "Zee5 TV Series", "genre/zee5-tv-series" to "Zee5",
) )
override suspend fun loadLinks( override suspend fun loadLinks(

View file

@ -11,7 +11,7 @@ import java.net.URI
open class Movierulzhd : MainAPI() { open class Movierulzhd : MainAPI() {
override var mainUrl = "https://movierulzhd.host" override var mainUrl = "https://movierulzhd.fit"
var directUrl = "" var directUrl = ""
override var name = "Movierulzhd" override var name = "Movierulzhd"
override val hasMainPage = true override val hasMainPage = true

View file

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties import org.jetbrains.kotlin.konan.properties.Properties
// use an integer for version numbers // use an integer for version numbers
version = 216 version = 217
android { android {
defaultConfig { defaultConfig {

View file

@ -125,7 +125,7 @@ open class SoraStream : TmdbProvider() {
const val gMoviesAPI = "https://gdrivemovies.xyz" const val gMoviesAPI = "https://gdrivemovies.xyz"
const val hdmovies4uAPI = "https://hdmovies4u.dad" const val hdmovies4uAPI = "https://hdmovies4u.dad"
const val vegaMoviesAPI = "https://vegamovies.dad" const val vegaMoviesAPI = "https://vegamovies.dad"
const val dotmoviesAPI = "https://dotmovies.bet" const val dotmoviesAPI = "https://dotmovies.rsvp"
const val tvMoviesAPI = "https://www.tvseriesnmovies.com" const val tvMoviesAPI = "https://www.tvseriesnmovies.com"
const val moviezAddAPI = "https://ww3.moviezaddiction.click" const val moviezAddAPI = "https://ww3.moviezaddiction.click"
const val bollyMazaAPI = "https://ww3.bollymaza.click" const val bollyMazaAPI = "https://ww3.bollymaza.click"