sora: added WatchCartoon

This commit is contained in:
monica 2023-12-24 16:09:45 +07:00
parent 9d9580b050
commit eb128bf97a
7 changed files with 93 additions and 3 deletions

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 = 208 version = 209
android { android {
defaultConfig { defaultConfig {

View file

@ -10,6 +10,7 @@ import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.apmap
import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.base64Decode import com.lagradost.cloudstream3.base64Decode
import com.lagradost.cloudstream3.extractors.Jeniusplay
import com.lagradost.cloudstream3.extractors.Pixeldrain import com.lagradost.cloudstream3.extractors.Pixeldrain
import com.lagradost.cloudstream3.extractors.Vidplay import com.lagradost.cloudstream3.extractors.Vidplay
import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.*
@ -409,4 +410,9 @@ class Vidplay2 : Vidplay() {
class Flaswish : Filesim() { class Flaswish : Filesim() {
override val name = "Flaswish" override val name = "Flaswish"
override var mainUrl = "https://flaswish.com" override var mainUrl = "https://flaswish.com"
}
class Comedyshow : Jeniusplay() {
override val mainUrl = "https://comedyshow.to"
override val name = "Comedyshow"
} }

View file

@ -14,7 +14,6 @@ import com.lagradost.nicehttp.RequestBodyTypes
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.internal.closeQuietly
import org.jsoup.Jsoup import org.jsoup.Jsoup
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.select.Elements import org.jsoup.select.Elements
@ -323,6 +322,52 @@ object SoraExtractor : SoraStream() {
} }
suspend fun invokeWatchCartoon(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val fixTitle = title.createSlug()
val url = if (season == null) {
"$watchCartoonAPI/movies/$fixTitle-$year"
} else {
"$watchCartoonAPI/episode/$fixTitle-season-$season-episode-$episode"
}
val req = app.get(url)
val host = getBaseUrl(req.url)
val doc = req.document
val id = doc.select("link[rel=shortlink]").attr("href").substringAfterLast("=")
doc.select("div.form-group.list-server option").apmap {
val server = app.get(
"$host/ajax-get-link-stream/?server=${it.attr("value")}&filmId=$id",
headers = mapOf(
"X-Requested-With" to "XMLHttpRequest"
)
).text
loadExtractor(server, "$host/", subtitleCallback) { link ->
if (link.quality == Qualities.Unknown.value) {
callback.invoke(
ExtractorLink(
"WatchCartoon",
"WatchCartoon",
link.url,
link.referer,
Qualities.P720.value,
link.type,
link.headers,
link.extractorData
)
)
}
}
}
}
suspend fun invokeNetmovies( suspend fun invokeNetmovies(
title: String? = null, title: String? = null,
year: Int? = null, year: Int? = null,
@ -1702,6 +1747,7 @@ object SoraExtractor : SoraStream() {
imdbId: String? = null, imdbId: String? = null,
season: Int? = null, season: Int? = null,
episode: Int? = null, episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
) { ) {
val url = if (season == null) { val url = if (season == null) {
@ -1717,7 +1763,7 @@ object SoraExtractor : SoraStream() {
}.apmap { }.apmap {
when (it.second) { when (it.second) {
"Player F" -> { "Player F" -> {
invokeSmashyFfix(it.second, it.first, url, callback) invokeSmashyFfix(it.second, it.first, url, subtitleCallback, callback)
} }
"Player D (Hindi)" -> { "Player D (Hindi)" -> {

View file

@ -46,6 +46,7 @@ import com.hexated.SoraExtractor.invokeVidsrcto
import com.hexated.SoraExtractor.invokeCinemaTv import com.hexated.SoraExtractor.invokeCinemaTv
import com.hexated.SoraExtractor.invokeFebbox import com.hexated.SoraExtractor.invokeFebbox
import com.hexated.SoraExtractor.invokeOmovies import com.hexated.SoraExtractor.invokeOmovies
import com.hexated.SoraExtractor.invokeWatchCartoon
import com.hexated.SoraExtractor.invokeWatchsomuch import com.hexated.SoraExtractor.invokeWatchsomuch
import com.hexated.SoraExtractor.invokeZshow import com.hexated.SoraExtractor.invokeZshow
import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbId import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbId
@ -115,6 +116,7 @@ open class SoraStream : TmdbProvider() {
const val showflixAPI = "https://showflix.space" const val showflixAPI = "https://showflix.space"
const val aoneroomAPI = "https://api3.aoneroom.com" const val aoneroomAPI = "https://api3.aoneroom.com"
const val febboxAPI = "https://www.febbox.com" const val febboxAPI = "https://www.febbox.com"
const val watchCartoonAPI = "https://www1.watchcartoononline.bz"
const val fdMoviesAPI = "https://freedrivemovie.com" const val fdMoviesAPI = "https://freedrivemovie.com"
const val uhdmoviesAPI = "https://uhdmovies.zip" const val uhdmoviesAPI = "https://uhdmovies.zip"
@ -450,6 +452,16 @@ open class SoraStream : TmdbProvider() {
callback callback
) )
}, },
{
if (!res.isAnime && res.isCartoon) invokeWatchCartoon(
res.title,
res.year,
res.season,
res.episode,
subtitleCallback,
callback
)
},
{ {
if (!res.isAnime) invokeVidsrcto( if (!res.isAnime) invokeVidsrcto(
res.imdbId, res.imdbId,
@ -568,6 +580,7 @@ open class SoraStream : TmdbProvider() {
res.imdbId, res.imdbId,
res.season, res.season,
res.episode, res.episode,
subtitleCallback,
callback callback
) )
}, },

View file

@ -32,6 +32,7 @@ import com.hexated.SoraExtractor.invokeVidsrcto
import com.hexated.SoraExtractor.invokeCinemaTv import com.hexated.SoraExtractor.invokeCinemaTv
import com.hexated.SoraExtractor.invokeFebbox import com.hexated.SoraExtractor.invokeFebbox
import com.hexated.SoraExtractor.invokeOmovies import com.hexated.SoraExtractor.invokeOmovies
import com.hexated.SoraExtractor.invokeWatchCartoon
import com.hexated.SoraExtractor.invokeWatchsomuch import com.hexated.SoraExtractor.invokeWatchsomuch
import com.hexated.SoraExtractor.invokeZshow import com.hexated.SoraExtractor.invokeZshow
import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.SubtitleFile
@ -106,6 +107,16 @@ class SoraStreamLite : SoraStream() {
{ {
invokeDbgo(res.imdbId, res.season, res.episode, subtitleCallback, callback) invokeDbgo(res.imdbId, res.season, res.episode, subtitleCallback, callback)
}, },
{
if (!res.isAnime && res.isCartoon) invokeWatchCartoon(
res.title,
res.year,
res.season,
res.episode,
subtitleCallback,
callback
)
},
{ {
if (res.isAnime) invokeAnimes( if (res.isAnime) invokeAnimes(
res.title, res.title,
@ -159,6 +170,7 @@ class SoraStreamLite : SoraStream() {
res.imdbId, res.imdbId,
res.season, res.season,
res.episode, res.episode,
subtitleCallback,
callback callback
) )
}, },

View file

@ -30,5 +30,6 @@ class SoraStreamPlugin: Plugin() {
registerExtractorAPI(Netembed()) registerExtractorAPI(Netembed())
registerExtractorAPI(Vidplay2()) registerExtractorAPI(Vidplay2())
registerExtractorAPI(Flaswish()) registerExtractorAPI(Flaswish())
registerExtractorAPI(Comedyshow())
} }
} }

View file

@ -402,6 +402,7 @@ suspend fun invokeSmashyFfix(
name: String, name: String,
url: String, url: String,
ref: String, ref: String,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
) { ) {
val json = app.get(url, referer = ref, headers = mapOf("X-Requested-With" to "XMLHttpRequest")) val json = app.get(url, referer = ref, headers = mapOf("X-Requested-With" to "XMLHttpRequest"))
@ -414,6 +415,17 @@ suspend fun invokeSmashyFfix(
).forEach(callback) ).forEach(callback)
} }
json?.subtitleUrls?.split(",")?.map { sub ->
val lang = "\\[(.*)]".toRegex().find(sub)?.groupValues?.get(1)
val subUrl = sub.replace("[$lang]", "").trim()
subtitleCallback.invoke(
SubtitleFile(
lang ?: return@map,
subUrl
)
)
}
} }
suspend fun invokeSmashyD( suspend fun invokeSmashyD(