diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index b2614d35..af164cb7 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 = 157 +version = 158 android { defaultConfig { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 6cd9e89c..56aee7cd 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -644,6 +644,74 @@ object SoraExtractor : SoraStream() { } + suspend fun invokeDramaday( + title: String? = null, + year: Int? = null, + season: Int? = null, + episode: Int? = null, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + fun String.getQuality(): String? = + Regex("""\d{3,4}[pP]""").find(this)?.groupValues?.getOrNull(0) + + fun String.getTag(): String? = + Regex("""\d{3,4}[pP]\s*(.*)""").find(this)?.groupValues?.getOrNull(1) + + val slug = title.createSlug() + val epsSlug = getEpisodeSlug(season, episode) + val url = if (season == null) { + "$dramadayAPI/$slug-$year/" + } else { + "$dramadayAPI/$slug/" + } + val res = app.get(url).document + + val servers = if (season == null) { + val player = res.select("div.tabs__pane p a[href*=https://ouo]").attr("href") + val ouo = bypassOuo(player) + app.get(ouo ?: return).document.select("article p:matches(\\d{3,4}[pP]) + p:has(a)") + .flatMap { ele -> + val entry = ele.previousElementSibling()?.text() ?: "" + ele.select("a").map { + Triple(entry.getQuality(), entry.getTag(), it.attr("href")) + }.filter { + it.third.startsWith("https://pixeldrain.com") || it.third.startsWith("https://krakenfiles.com") + } + } + } else { + val data = res.select("tbody tr:has(td[data-order=${epsSlug.second}])") + val qualities = + data.select("td:nth-child(2)").attr("data-order").split("
").map { it } + val iframe = data.select("a[href*=https://ouo]").map { it.attr("href") } + qualities.zip(iframe).map { + Triple(it.first.getQuality(), it.first.getTag(), it.second) + } + } + + servers.filter { it.first == "720p" || it.first == "1080p" }.apmap { + val server = if (it.third.startsWith("https://ouo")) bypassOuo(it.third) else it.third + loadExtractor(server ?: return@apmap, "$dramadayAPI/", subtitleCallback) { link -> + callback.invoke( + ExtractorLink( + link.source, + "${link.name} ${it.second}", + link.url, + link.referer, + when { + link.isM3u8 -> link.quality + else -> getQualityFromName(it.first) + }, + link.isM3u8, + link.headers, + link.extractorData + ) + ) + } + } + + } + suspend fun invokeKimcartoon( title: String? = null, season: Int? = null, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index 970288df..36df7dc2 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -18,6 +18,7 @@ import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.metaproviders.TmdbProvider import com.hexated.SoraExtractor.invokeDahmerMovies import com.hexated.SoraExtractor.invokeDoomovies +import com.hexated.SoraExtractor.invokeDramaday import com.hexated.SoraExtractor.invokeDreamfilm import com.hexated.SoraExtractor.invokeFDMovies import com.hexated.SoraExtractor.invokeFlixon @@ -130,11 +131,13 @@ open class SoraStream : TmdbProvider() { const val doomoviesAPI = "https://doomovies.net" const val primewireAPI = "https://real-primewire.club" const val vidsrctoAPI = "https://vidsrc.to" + const val dramadayAPI = "https://dramaday.me" // INDEX SITE const val dahmerMoviesAPI = "https://edytjedhgmdhm.abfhaqrhbnf.workers.dev" const val shinobiMovieAPI = "https://home.shinobicloud.cf/0:" - val cryMoviesAPI = base64DecodeAPI("ZXY=LmQ=cnM=a2U=b3I=Lnc=ZXI=ZGQ=bGE=cy0=b2I=YWM=Lmo=YWw=aW4=LWY=cm4=Ym8=cmU=Ly8=czo=dHA=aHQ=") + val cryMoviesAPI = + base64DecodeAPI("ZXY=LmQ=cnM=a2U=b3I=Lnc=ZXI=ZGQ=bGE=cy0=b2I=YWM=Lmo=YWw=aW4=LWY=cm4=Ym8=cmU=Ly8=czo=dHA=aHQ=") fun getType(t: String?): TvType { return when (t) { @@ -244,8 +247,8 @@ 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 isAsian = !isAnime && (res.original_language == "zh" || res.original_language == "ko") val keywords = res.keywords?.results?.mapNotNull { it.name }.orEmpty() .ifEmpty { res.keywords?.keywords?.mapNotNull { it.name } } @@ -286,6 +289,7 @@ open class SoraStream : TmdbProvider() { jpTitle = res.alternative_titles?.results?.find { it.iso_3166_1 == "JP" }?.title, date = season.airDate, airedDate = res.releaseDate ?: res.firstAirDate, + isAsian = isAsian, ).toJson(), name = eps.name + if (isUpcoming(eps.airDate)) " - [UPCOMING]" else "", season = eps.seasonNumber, @@ -332,6 +336,7 @@ open class SoraStream : TmdbProvider() { isAnime = isAnime, jpTitle = res.alternative_titles?.results?.find { it.iso_3166_1 == "JP" }?.title, airedDate = res.releaseDate ?: res.firstAirDate, + isAsian = isAsian, ).toJson(), ) { this.posterUrl = poster @@ -725,6 +730,16 @@ open class SoraStream : TmdbProvider() { callback ) }, + { + if(res.isAsian) invokeDramaday( + res.title, + res.year, + res.season, + res.episode, + subtitleCallback, + callback + ) + } ) return true @@ -748,6 +763,7 @@ open class SoraStream : TmdbProvider() { val jpTitle: String? = null, val date: String? = null, val airedDate: String? = null, + val isAsian: Boolean = false, ) data class Data( diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt index df1b3e27..6b3a7818 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt @@ -4,6 +4,7 @@ import com.hexated.SoraExtractor.invokeAnimes import com.hexated.SoraExtractor.invokeAsk4Movies import com.hexated.SoraExtractor.invokeDbgo import com.hexated.SoraExtractor.invokeDoomovies +import com.hexated.SoraExtractor.invokeDramaday import com.hexated.SoraExtractor.invokeDreamfilm import com.hexated.SoraExtractor.invokeFilmxy import com.hexated.SoraExtractor.invokeFlixon @@ -345,6 +346,16 @@ class SoraStreamLite : SoraStream() { callback ) }, + { + if(res.isAsian) invokeDramaday( + res.title, + res.year, + res.season, + res.episode, + subtitleCallback, + callback + ) + } ) return true