diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index a2c2edaf..ecd2fa74 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 35 +version = 36 cloudstream { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 8910a966..706f427f 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -1234,7 +1234,7 @@ object SoraExtractor : SoraStream() { delay(1000) val res = app.get(link ?: return@apmap null).document val bitLink = res.selectFirst("a.btn.btn-outline-success")?.attr("href") ?: return@apmap null - val downLink = app.get(fixUrl(bitLink, base)).document.selectFirst("div.mb-4 a")?.attr("href") + val downLink = app.get(fixUrl(bitLink, base)).document.select("div.mb-4 a").randomOrNull()?.attr("href") val downPage = app.get(downLink ?: return@apmap null).document val downloadLink = downPage.selectFirst("form[method=post] a.btn.btn-success") @@ -1263,6 +1263,48 @@ object SoraExtractor : SoraStream() { } + suspend fun invokeFwatayako( + imdbId: String? = null, + season: Int? = null, + episode: Int? = null, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val request = app.get("$fwatayakoAPI/IAF0wWTdNYZm?imdb_id=$imdbId") + if (!request.isSuccessful) return + val files = request.document.selectFirst("input#files")?.attr("value") + .let { + if (season == null) { + it?.replace("\"381\"", "\"movie\"") + } else { + it?.replace("\"381\"", "\"tv\"") + } + }.let { tryParseJson(it) } ?: return + + val sourcesLink = if (season == null) { + files.sourcesMovie + } else { + files.sourcesTv?.find { it.id == season }?.folder?.find { it.id == "${season}_${episode}" }?.file + } + + sourcesLink?.split(",")?.map { + val source = it.substringBefore("or").trim() + val quality = + Regex("\\[([0-9]{3,4})p]").find(source)?.groupValues?.getOrNull(1)?.toIntOrNull() + val link = httpsify(source.replace("[${quality}p]", "").trim()) + callback.invoke( + ExtractorLink( + "Fwatayako", + "Fwatayako", + link, + "$fwatayakoAPI/", + quality ?: Qualities.Unknown.value, + isM3u8 = true + ) + ) + } + } + } data class FilmxyCookies( @@ -1578,3 +1620,17 @@ data class AnimixData( @JsonProperty("title_japanese") val title_japanese: String? = null, ) +data class EpisodesFwatayako( + @JsonProperty("id") val id: String? = null, + @JsonProperty("file") val file: String? = null, +) + +data class SeasonFwatayako( + @JsonProperty("id") val id: Int? = null, + @JsonProperty("folder") val folder: ArrayList? = arrayListOf(), +) + +data class SourcesFwatayako( + @JsonProperty("movie") val sourcesMovie: String? = null, + @JsonProperty("tv") val sourcesTv: ArrayList? = arrayListOf(), +) \ No newline at end of file diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index fc99a4f5..2bad93cb 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -22,6 +22,7 @@ import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.metaproviders.TmdbProvider import com.hexated.SoraExtractor.invoZoro +import com.hexated.SoraExtractor.invokeFwatayako import com.hexated.SoraExtractor.invokeLing import com.hexated.SoraExtractor.invokeUhdmovies import com.lagradost.cloudstream3.utils.AppUtils.parseJson @@ -70,6 +71,7 @@ open class SoraStream : TmdbProvider() { const val kissKhAPI = "https://kisskh.me" const val lingAPI = "https://ling-online.net" const val uhdmoviesAPI = "https://uhdmovies.site" + const val fwatayakoAPI = "https://5100.svetacdn.in" fun getType(t: String?): TvType { return when (t) { @@ -440,6 +442,9 @@ open class SoraStream : TmdbProvider() { callback ) }, + { + invokeFwatayako(res.imdbId, res.season, res.episode, subtitleCallback, callback) + }, ) return true