From 2d90346b9e93946d64cd7460661461799355fa12 Mon Sep 17 00:00:00 2001 From: hexated Date: Fri, 7 Jul 2023 14:32:57 +0700 Subject: [PATCH 1/5] sora: added 4cartoon --- SoraStream/build.gradle.kts | 2 +- .../main/kotlin/com/hexated/SoraExtractor.kt | 48 +++++++++++++++++++ .../src/main/kotlin/com/hexated/SoraParser.kt | 4 ++ .../src/main/kotlin/com/hexated/SoraStream.kt | 16 ++++--- .../main/kotlin/com/hexated/SoraStreamLite.kt | 12 ++++- 5 files changed, 74 insertions(+), 8 deletions(-) diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index 65ee9df5..e43f70eb 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.konan.properties.Properties // use an integer for version numbers -version = 142 +version = 143 android { defaultConfig { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 5f105550..754dd9ee 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -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()?.videoSource + + callback.invoke( + ExtractorLink( + "4Cartoon", + "4Cartoon", + source ?: return, + "$iframeUrl/", + Qualities.P720.value, + true, + ) + ) + + } + } diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt index 6651bb7d..9646b846 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt @@ -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, +) diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index faf0f2c7..7aa8b215 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -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) } ) diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt index 247485ab..6f02e50a 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt @@ -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 From 58f142a8d78c2cbb86e627a76fea7e0f18b7391b Mon Sep 17 00:00:00 2001 From: hexated Date: Fri, 7 Jul 2023 15:10:25 +0700 Subject: [PATCH 2/5] small fix --- SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt | 8 ++++---- SoraStream/src/main/kotlin/com/hexated/SoraStream.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 754dd9ee..9b40016b 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -1017,14 +1017,14 @@ object SoraExtractor : SoraStream() { "X-Requested-With" to "XMLHttpRequest", ) animeId?.apmap { id -> - val episodeId = app.get("$zoroAPI/ajax/v2/episode/list/${id ?: return@apmap}", headers = headers) + val episodeId = app.get("$zoroAPI/ajax/episode/list/${id ?: return@apmap}", headers = headers) .parsedSafe()?.html?.let { Jsoup.parse(it) }?.select("div.ss-list a")?.find { it.attr("data-number") == "${episode ?: 1}" } ?.attr("data-id") val servers = - app.get("$zoroAPI/ajax/v2/episode/servers?episodeId=${episodeId ?: return@apmap}", headers = headers) + app.get("$zoroAPI/ajax/episode/servers?episodeId=${episodeId ?: return@apmap}", headers = headers) .parsedSafe()?.html?.let { Jsoup.parse(it) } ?.select("div.item.server-item")?.map { Triple( @@ -1036,10 +1036,10 @@ object SoraExtractor : SoraStream() { servers?.apmap servers@{ server -> val iframe = - app.get("$zoroAPI/ajax/v2/episode/sources?id=${server.second ?: return@servers}", headers = headers) + app.get("$zoroAPI/ajax/episode/sources?id=${server.second ?: return@servers}", headers = headers) .parsedSafe()?.link ?: return@servers val audio = if (server.third == "sub") "Raw" else "English Dub" - if (server.first == "Vidstreaming" || server.first == "MegaCloud") { + if (server.first.contains(Regex("Vidstreaming|MegaCloud|Vidcloud"))) { extractRabbitStream( "${server.first} [$audio]", iframe, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index 7aa8b215..4687e7a9 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -100,7 +100,7 @@ open class SoraStream : TmdbProvider() { const val filmxyAPI = "https://www.filmxy.vip" const val kimcartoonAPI = "https://kimcartoon.li" const val xMovieAPI = "https://xemovies.to" - const val zoroAPI = "https://aniwatch.to" + const val zoroAPI = "https://kaido.to" const val crunchyrollAPI = "https://beta-api.crunchyroll.com" const val kissKhAPI = "https://kisskh.co" const val lingAPI = "https://ling-online.net" From 8e68ba73e50b77b2eac7e069cc6224f3966dc34b Mon Sep 17 00:00:00 2001 From: hexated Date: Fri, 7 Jul 2023 15:18:35 +0700 Subject: [PATCH 3/5] small fix --- SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt index 74ea627e..c47faa3b 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt @@ -1952,7 +1952,7 @@ object RabbitStream { } suspend fun getZoroKey(): String { - return app.get("https://raw.githubusercontent.com/enimax-anime/key/e6/key.txt").text + return app.get("https://raw.githubusercontent.com/enimax-anime/key/e0/key.txt").text } private inline fun decryptMapped(input: String, key: String): T? { From 47fc2569758c6dd699d44a0c84154d2e88fc7cfc Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 9 Jul 2023 02:20:33 +0700 Subject: [PATCH 4/5] fix Gomunimeis --- Gomunimeis/build.gradle.kts | 2 +- Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gomunimeis/build.gradle.kts b/Gomunimeis/build.gradle.kts index 5c6d720f..76ef54dd 100644 --- a/Gomunimeis/build.gradle.kts +++ b/Gomunimeis/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 5 +version = 6 cloudstream { diff --git a/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt b/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt index 43e8616e..afcfa844 100644 --- a/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt +++ b/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt @@ -129,7 +129,7 @@ class Gomunimeis : MainAPI() { .let { id -> app.get("https://gomunimes.com/stream?id=$id") .parsedSafe()?.server?.streamsb?.link?.let { link -> - loadExtractor(link, "https://vidgomunime.xyz/", subtitleCallback, callback) + loadExtractor(link.replace("vidgomunimesb.xyz", "watchsb.com"), mainUrl, subtitleCallback, callback) } } From 24e3048f21ad10bd54770bb32d107740027d8cc4 Mon Sep 17 00:00:00 2001 From: tuan041 <30403510+tuan041@users.noreply.github.com> Date: Sun, 9 Jul 2023 17:57:24 +0700 Subject: [PATCH 5/5] Fix PhimmoichillProvider (#174) * Fix PhimmoichillProvider * Fix PhimmoichillProvider --- PhimmoichillProvider/build.gradle.kts | 2 +- .../com/hexated/PhimmoichillProvider.kt | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/PhimmoichillProvider/build.gradle.kts b/PhimmoichillProvider/build.gradle.kts index 091dbc67..0e836afc 100644 --- a/PhimmoichillProvider/build.gradle.kts +++ b/PhimmoichillProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 4 +version = 5 cloudstream { diff --git a/PhimmoichillProvider/src/main/kotlin/com/hexated/PhimmoichillProvider.kt b/PhimmoichillProvider/src/main/kotlin/com/hexated/PhimmoichillProvider.kt index 75e214ce..79823186 100644 --- a/PhimmoichillProvider/src/main/kotlin/com/hexated/PhimmoichillProvider.kt +++ b/PhimmoichillProvider/src/main/kotlin/com/hexated/PhimmoichillProvider.kt @@ -9,7 +9,7 @@ import org.jsoup.nodes.Element import java.net.URLDecoder class PhimmoichillProvider : MainAPI() { - override var mainUrl = "https://phimmoichilla.net" + override var mainUrl = "https://phimmoichilld.net" override var name = "Phimmoichill" override val hasMainPage = true override var lang = "vi" @@ -26,9 +26,11 @@ class PhimmoichillProvider : MainAPI() { "$mainUrl/list/phim-le/page-" to "Phim Lẻ", "$mainUrl/list/phim-bo/page-" to "Phim Bộ", "$mainUrl/genre/phim-hoat-hinh/page-" to "Phim Hoạt Hình", + "$mainUrl/genre/phim-anime/page-" to "Phim Anime", "$mainUrl/country/phim-han-quoc/page-" to "Phim Hàn Quốc", "$mainUrl/country/phim-trung-quoc/page-" to "Phim Trung Quốc", "$mainUrl/country/phim-thai-lan/page-" to "Phim Thái Lan", + "$mainUrl/genre/phim-sap-chieu/page-" to "Phim Sắp Chiếu", ) override suspend fun getMainPage( @@ -64,6 +66,10 @@ class PhimmoichillProvider : MainAPI() { this.posterUrl = posterUrl addSub(episode) } + } else if (temp.contains(Regex("Trailer"))) { + newMovieSearchResponse(title, href, TvType.Movie) { + this.posterUrl = posterUrl + } } else { val quality = temp.replace(Regex("(-.*)|(\\|.*)|(?i)(VietSub.*)|(?i)(Thuyết.*)"), "").trim() @@ -83,21 +89,20 @@ class PhimmoichillProvider : MainAPI() { } } - override suspend fun load(url: String): LoadResponse { + override suspend fun load( url: String ): LoadResponse { val document = app.get(url).document val title = document.selectFirst("h1[itemprop=name]")?.text()?.trim().toString() val link = document.select("ul.list-button li:last-child a").attr("href") val poster = document.selectFirst("div.image img[itemprop=image]")?.attr("src") - val tags = document.select("ul.entry-meta.block-film li:nth-child(4) a").map { it.text() } + val tags = document.select("ul.entry-meta.block-film li:nth-child(4) a").map { it.text()!!.substringAfter("Phim") } val year = document.select("ul.entry-meta.block-film li:nth-child(2) a").text().trim() .toIntOrNull() val tvType = if (document.select("div.latest-episode").isNotEmpty() ) TvType.TvSeries else TvType.Movie - val description = document.select("div#film-content").text().trim() - val trailer = - document.select("div#trailer script").last()?.data()?.substringAfter("file: \"") - ?.substringBefore("\",") + val description = document.select("div#film-content").text().substringAfter("Full HD Vietsub Thuyết Minh").substringBefore("@phimmoi").trim() + val trailer = document.select("body script") + .find { it.data().contains("youtube.com") }?.data()?.substringAfterLast("file: \"")?.substringBefore("\",") val rating = document.select("ul.entry-meta.block-film li:nth-child(7) span").text().toRatingInt() val actors = document.select("ul.entry-meta.block-film li:last-child a").map { it.text() } @@ -143,7 +148,7 @@ class PhimmoichillProvider : MainAPI() { } } } - + override suspend fun loadLinks( data: String, isCasting: Boolean, @@ -156,8 +161,7 @@ class PhimmoichillProvider : MainAPI() { .find { it.data().contains("filmInfo.episodeID =") }?.data()?.let { script -> val id = script.substringAfter("filmInfo.episodeID = parseInt('") app.post( - // Not mainUrl - url = "https://phimmoichills.net/pmplayer.php", + url = "${this.mainUrl}/chillsplayer.php", data = mapOf("qcao" to id, "sv" to "0"), referer = data, headers = mapOf( @@ -171,6 +175,7 @@ class PhimmoichillProvider : MainAPI() { listOf( Pair("https://so-trym.topphimmoi.org/raw/$key/index.m3u8", "PMFAST"), Pair("https://dash.megacdn.xyz/raw/$key/index.m3u8", "PMHLS"), + Pair("https://so-trym.phimchill.net/dash/$key/index.m3u8", "PMPRO"), Pair("https://dash.megacdn.xyz/dast/$key/index.m3u8", "PMBK") ).apmap { (link, source) -> safeApiCall {