mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: added WatchCartoon
This commit is contained in:
parent
9d9580b050
commit
eb128bf97a
7 changed files with 93 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 208
|
||||
version = 209
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.lagradost.cloudstream3.SubtitleFile
|
|||
import com.lagradost.cloudstream3.apmap
|
||||
import com.lagradost.cloudstream3.app
|
||||
import com.lagradost.cloudstream3.base64Decode
|
||||
import com.lagradost.cloudstream3.extractors.Jeniusplay
|
||||
import com.lagradost.cloudstream3.extractors.Pixeldrain
|
||||
import com.lagradost.cloudstream3.extractors.Vidplay
|
||||
import com.lagradost.cloudstream3.utils.*
|
||||
|
@ -409,4 +410,9 @@ class Vidplay2 : Vidplay() {
|
|||
class Flaswish : Filesim() {
|
||||
override val name = "Flaswish"
|
||||
override var mainUrl = "https://flaswish.com"
|
||||
}
|
||||
|
||||
class Comedyshow : Jeniusplay() {
|
||||
override val mainUrl = "https://comedyshow.to"
|
||||
override val name = "Comedyshow"
|
||||
}
|
|
@ -14,7 +14,6 @@ import com.lagradost.nicehttp.RequestBodyTypes
|
|||
import kotlinx.coroutines.delay
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import okhttp3.internal.closeQuietly
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
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(
|
||||
title: String? = null,
|
||||
year: Int? = null,
|
||||
|
@ -1702,6 +1747,7 @@ object SoraExtractor : SoraStream() {
|
|||
imdbId: String? = null,
|
||||
season: Int? = null,
|
||||
episode: Int? = null,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit,
|
||||
) {
|
||||
val url = if (season == null) {
|
||||
|
@ -1717,7 +1763,7 @@ object SoraExtractor : SoraStream() {
|
|||
}.apmap {
|
||||
when (it.second) {
|
||||
"Player F" -> {
|
||||
invokeSmashyFfix(it.second, it.first, url, callback)
|
||||
invokeSmashyFfix(it.second, it.first, url, subtitleCallback, callback)
|
||||
}
|
||||
|
||||
"Player D (Hindi)" -> {
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.hexated.SoraExtractor.invokeVidsrcto
|
|||
import com.hexated.SoraExtractor.invokeCinemaTv
|
||||
import com.hexated.SoraExtractor.invokeFebbox
|
||||
import com.hexated.SoraExtractor.invokeOmovies
|
||||
import com.hexated.SoraExtractor.invokeWatchCartoon
|
||||
import com.hexated.SoraExtractor.invokeWatchsomuch
|
||||
import com.hexated.SoraExtractor.invokeZshow
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbId
|
||||
|
@ -115,6 +116,7 @@ open class SoraStream : TmdbProvider() {
|
|||
const val showflixAPI = "https://showflix.space"
|
||||
const val aoneroomAPI = "https://api3.aoneroom.com"
|
||||
const val febboxAPI = "https://www.febbox.com"
|
||||
const val watchCartoonAPI = "https://www1.watchcartoononline.bz"
|
||||
|
||||
const val fdMoviesAPI = "https://freedrivemovie.com"
|
||||
const val uhdmoviesAPI = "https://uhdmovies.zip"
|
||||
|
@ -450,6 +452,16 @@ open class SoraStream : TmdbProvider() {
|
|||
callback
|
||||
)
|
||||
},
|
||||
{
|
||||
if (!res.isAnime && res.isCartoon) invokeWatchCartoon(
|
||||
res.title,
|
||||
res.year,
|
||||
res.season,
|
||||
res.episode,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
},
|
||||
{
|
||||
if (!res.isAnime) invokeVidsrcto(
|
||||
res.imdbId,
|
||||
|
@ -568,6 +580,7 @@ open class SoraStream : TmdbProvider() {
|
|||
res.imdbId,
|
||||
res.season,
|
||||
res.episode,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
},
|
||||
|
|
|
@ -32,6 +32,7 @@ import com.hexated.SoraExtractor.invokeVidsrcto
|
|||
import com.hexated.SoraExtractor.invokeCinemaTv
|
||||
import com.hexated.SoraExtractor.invokeFebbox
|
||||
import com.hexated.SoraExtractor.invokeOmovies
|
||||
import com.hexated.SoraExtractor.invokeWatchCartoon
|
||||
import com.hexated.SoraExtractor.invokeWatchsomuch
|
||||
import com.hexated.SoraExtractor.invokeZshow
|
||||
import com.lagradost.cloudstream3.SubtitleFile
|
||||
|
@ -106,6 +107,16 @@ class SoraStreamLite : SoraStream() {
|
|||
{
|
||||
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(
|
||||
res.title,
|
||||
|
@ -159,6 +170,7 @@ class SoraStreamLite : SoraStream() {
|
|||
res.imdbId,
|
||||
res.season,
|
||||
res.episode,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
},
|
||||
|
|
|
@ -30,5 +30,6 @@ class SoraStreamPlugin: Plugin() {
|
|||
registerExtractorAPI(Netembed())
|
||||
registerExtractorAPI(Vidplay2())
|
||||
registerExtractorAPI(Flaswish())
|
||||
registerExtractorAPI(Comedyshow())
|
||||
}
|
||||
}
|
|
@ -402,6 +402,7 @@ suspend fun invokeSmashyFfix(
|
|||
name: String,
|
||||
url: String,
|
||||
ref: String,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit,
|
||||
) {
|
||||
val json = app.get(url, referer = ref, headers = mapOf("X-Requested-With" to "XMLHttpRequest"))
|
||||
|
@ -414,6 +415,17 @@ suspend fun invokeSmashyFfix(
|
|||
).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(
|
||||
|
|
Loading…
Reference in a new issue