sora: added 4cartoon

This commit is contained in:
hexated 2023-07-07 14:32:57 +07:00
parent eff0f36919
commit 2d90346b9e
5 changed files with 74 additions and 8 deletions

View file

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

View file

@ -3163,6 +3163,54 @@ object SoraExtractor : SoraStream() {
}
suspend fun invokeFourCartoon(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit
) {
val fixTitle = title.createSlug()
val headers = mapOf(
"X-Requested-With" to "XMLHttpRequest"
)
val url = if (season == null) {
"$fourCartoonAPI/movies/$fixTitle-$year"
} else {
"$fourCartoonAPI/episode/$fixTitle-season-$season-episode-$episode"
}
val document = app.get(url).document
val id = document.selectFirst("input[name=idpost]")?.attr("value")
val server = app.get(
"$fourCartoonAPI/ajax-get-link-stream/?server=streamango&filmId=${id ?: return}",
headers = headers
).text
val hash =
getAndUnpack(app.get(server, referer = fourCartoonAPI).text).substringAfter("(\"")
.substringBefore("\",")
val iframeUrl = getBaseUrl(server)
val source = app.post(
"$iframeUrl/player/index.php?data=$hash&do=getVideo", data = mapOf(
"hast" to hash,
"r" to "$fourCartoonAPI/",
),
headers = headers
).parsedSafe<FourCartoonSources>()?.videoSource
callback.invoke(
ExtractorLink(
"4Cartoon",
"4Cartoon",
source ?: return,
"$iframeUrl/",
Qualities.P720.value,
true,
)
)
}
}

View file

@ -500,3 +500,7 @@ data class EMovieTraks(
@JsonProperty("file") val file: String? = null,
@JsonProperty("label") val label: String? = null,
)
data class FourCartoonSources(
@JsonProperty("videoSource") val videoSource: String? = null,
)

View file

@ -50,6 +50,7 @@ import com.hexated.SoraExtractor.invokeShivamhw
import com.hexated.SoraExtractor.invokeSmashyStream
import com.hexated.SoraExtractor.invokeDumpStream
import com.hexated.SoraExtractor.invokeEmovies
import com.hexated.SoraExtractor.invokeFourCartoon
import com.hexated.SoraExtractor.invokePobmovies
import com.hexated.SoraExtractor.invokeTvMovies
import com.hexated.SoraExtractor.invokeUhdmovies
@ -103,7 +104,7 @@ open class SoraStream : TmdbProvider() {
const val crunchyrollAPI = "https://beta-api.crunchyroll.com"
const val kissKhAPI = "https://kisskh.co"
const val lingAPI = "https://ling-online.net"
const val uhdmoviesAPI = "https://uhdmovies.cc"
const val uhdmoviesAPI = "https://uhdmovies.life"
const val fwatayakoAPI = "https://5100.svetacdn.in"
const val gMoviesAPI = "https://gdrivemovies.xyz"
const val fdMoviesAPI = "https://freedrivemovie.lol"
@ -131,6 +132,7 @@ open class SoraStream : TmdbProvider() {
const val navyAPI = "https://navy-issue-i-239.site"
const val emoviesAPI = "https://emovies.si"
const val pobmoviesAPI = "https://pobmovies.cam"
const val fourCartoonAPI = "https://4cartoon.net"
// INDEX SITE
const val blackMoviesAPI = "https://dl.blacklistedbois.workers.dev/0:"
@ -265,8 +267,7 @@ open class SoraStream : TmdbProvider() {
val year = releaseDate?.split("-")?.first()?.toIntOrNull()
val rating = res.vote_average.toString().toRatingInt()
val genres = res.genres?.mapNotNull { it.name }
val isAnime =
genres?.contains("Animation") == true && (res.original_language == "zh" || res.original_language == "ja")
val isAnime = genres?.contains("Animation") == true && (res.original_language == "zh" || res.original_language == "ja")
val keywords = res.keywords?.results?.mapNotNull { it.name }.orEmpty()
.ifEmpty { res.keywords?.keywords?.mapNotNull { it.name } }
@ -306,7 +307,7 @@ open class SoraStream : TmdbProvider() {
epsTitle = eps.name,
jpTitle = res.alternative_titles?.results?.find { it.iso_3166_1 == "JP" }?.title,
date = season.airDate,
airedDate = res.releaseDate ?: res.firstAirDate
airedDate = res.releaseDate ?: res.firstAirDate,
).toJson(),
name = eps.name + if(isUpcoming(eps.airDate)) " - [UPCOMING]" else "",
season = eps.seasonNumber,
@ -350,7 +351,7 @@ open class SoraStream : TmdbProvider() {
orgTitle = orgTitle,
isAnime = isAnime,
jpTitle = res.alternative_titles?.results?.find { it.iso_3166_1 == "JP" }?.title,
airedDate = res.releaseDate ?: res.firstAirDate
airedDate = res.releaseDate ?: res.firstAirDate,
).toJson(),
) {
this.posterUrl = poster
@ -497,7 +498,7 @@ open class SoraStream : TmdbProvider() {
)
},
{
invokeKimcartoon(res.title, res.season, res.episode, subtitleCallback, callback)
if(!res.isAnime) invokeKimcartoon(res.title, res.season, res.episode, subtitleCallback, callback)
},
{
invokeXmovies(
@ -812,6 +813,9 @@ open class SoraStream : TmdbProvider() {
},
{
if(!res.isAnime && res.season == null) invokePobmovies(res.title, res.year, callback)
},
{
if(!res.isAnime) invokeFourCartoon(res.title, res.year, res.season, res.episode, callback)
}
)

View file

@ -28,6 +28,7 @@ import com.hexated.SoraExtractor.invokeSeries9
import com.hexated.SoraExtractor.invokeSmashyStream
import com.hexated.SoraExtractor.invokeDumpStream
import com.hexated.SoraExtractor.invokeEmovies
import com.hexated.SoraExtractor.invokeFourCartoon
import com.hexated.SoraExtractor.invokeVidSrc
import com.hexated.SoraExtractor.invokeWatchOnline
import com.hexated.SoraExtractor.invokeWatchsomuch
@ -187,7 +188,7 @@ class SoraStreamLite : SoraStream() {
)
},
{
invokeKimcartoon(res.title, res.season, res.episode, subtitleCallback, callback)
if(!res.isAnime) invokeKimcartoon(res.title, res.season, res.episode, subtitleCallback, callback)
},
{
invokeSmashyStream(
@ -299,6 +300,15 @@ class SoraStreamLite : SoraStream() {
callback
)
},
{
if(!res.isAnime) invokeFourCartoon(
res.title,
res.year,
res.season,
res.episode,
callback
)
}
)
return true