diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 9515add8..6e604f6b 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -5,10 +5,12 @@ import com.lagradost.cloudstream3.APIHolder import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.network.WebViewResolver import com.lagradost.cloudstream3.utils.AppUtils import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.loadExtractor +import com.lagradost.nicehttp.requestCreator object SoraExtractor : SoraStream() { @@ -84,7 +86,7 @@ object SoraExtractor : SoraStream() { } } - suspend fun invokeVidSrcSources( + suspend fun invokeVidSrc( id: Int? = null, season: Int? = null, episode: Int? = null, @@ -100,4 +102,38 @@ object SoraExtractor : SoraStream() { loadExtractor(url, null, subtitleCallback, callback) } + private suspend fun loadLinksWithWebView( + url: String, + callback: (ExtractorLink) -> Unit + ) { + val foundVideo = WebViewResolver( + Regex("""\.m3u8|i7njdjvszykaieynzsogaysdgb0hm8u1mzubmush4maopa4wde\.com""") + ).resolveUsingWebView( + requestCreator( + "GET", url, referer = "https://olgply.com/" + ) + ).first ?: return + + callback.invoke( + ExtractorLink( + "Olgply", + "Olgply", + foundVideo.url.toString(), + "", + Qualities.Unknown.value, + true + ) + ) + } + + suspend fun invokeOlgply( + id: Int? = null, + season: Int? = null, + episode: Int? = null, + callback: (ExtractorLink) -> Unit + ) { + val url = "https://olgply.xyz/${id}${season?.let { "/$it" } ?: ""}${episode?.let { "/$it" } ?: ""}" + loadLinksWithWebView(url, callback) + } + } \ 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 f30c1a58..326fb2fb 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -3,8 +3,9 @@ package com.hexated import com.fasterxml.jackson.annotation.JsonProperty import com.hexated.RandomUserAgent.getRandomUserAgent import com.hexated.SoraExtractor.invokeLocalSources +import com.hexated.SoraExtractor.invokeOlgply import com.hexated.SoraExtractor.invokeTwoEmbed -import com.hexated.SoraExtractor.invokeVidSrcSources +import com.hexated.SoraExtractor.invokeVidSrc import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.metaproviders.TmdbProvider import com.lagradost.cloudstream3.utils.AppUtils.parseJson @@ -244,7 +245,10 @@ open class SoraStream : TmdbProvider() { } }, { - invokeVidSrcSources(res.id, res.season, res.episode, subtitleCallback, callback) + invokeVidSrc(res.id, res.season, res.episode, subtitleCallback, callback) + }, + { + invokeOlgply(res.id, res.season, res.episode, callback) })