diff --git a/OlgplyProvider/build.gradle.kts b/OlgplyProvider/build.gradle.kts index 567e85f..846a41b 100644 --- a/OlgplyProvider/build.gradle.kts +++ b/OlgplyProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 2 +version = 3 cloudstream { diff --git a/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt b/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt index 07cdcdd..c2a0636 100644 --- a/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt +++ b/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt @@ -27,7 +27,6 @@ class OlgplyProvider : TmdbProvider() { // subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ) { - println("URKKKKKKKKKK $url") val foundVideo = WebViewResolver( Regex("""\.m3u8|i7njdjvszykaieynzsogaysdgb0hm8u1mzubmush4maopa4wde\.com""") ).resolveUsingWebView( @@ -62,55 +61,55 @@ class OlgplyProvider : TmdbProvider() { val apiUrl = "https://olgply.xyz/${tmdbId}${mappedData.season?.let { "/$it" } ?: ""}${mappedData.episode?.let { "/$it" } ?: ""}" - val html = - app.get(apiUrl, referer = "https://olgply.xyz/").text - val rhino = Context.enter() - rhino.optimizationLevel = -1 - val scope: Scriptable = rhino.initSafeStandardObjects() - val documentJs = """ - Plyr = function(){}; - - hlsPrototype = { - loadSource(url) { - this.url = url; - } - }; - - function Hls() {}; - Hls.isSupported = function(){return true}; - - Hls.prototype = hlsPrototype; - Hls.prototype.constructor = Hls; - - document = { - "querySelector" : function() {} - }; - """.trimIndent() - - val foundJs = jsRegex.find(html)?.groupValues?.getOrNull(0) ?: return false - try { - rhino.evaluateString(scope, documentJs + foundJs, "JavaScript", 1, null) - } catch (e: Exception) { - } - - val hls = scope.get("hls", scope) as? ScriptableObject - - if (hls != null) { - callback.invoke( - ExtractorLink( - this.name, - this.name, - hls["url"].toString(), - this.mainUrl + "/", - Qualities.Unknown.value, - headers = mapOf("range" to "bytes=0-"), - isM3u8 = true - ) - ) - } else { - // Disgraceful fallback, but the js for Movies4Discord refuses to work correctly :( - loadLinksWithWebView(apiUrl, callback) - } +// val html = +// app.get(apiUrl, referer = "https://olgply.xyz/").text +// val rhino = Context.enter() +// rhino.optimizationLevel = -1 +// val scope: Scriptable = rhino.initSafeStandardObjects() +// val documentJs = """ +// Plyr = function(){}; +// +// hlsPrototype = { +// loadSource(url) { +// this.url = url; +// } +// }; +// +// function Hls() {}; +// Hls.isSupported = function(){return true}; +// +// Hls.prototype = hlsPrototype; +// Hls.prototype.constructor = Hls; +// +// document = { +// "querySelector" : function() {} +// }; +// """.trimIndent() +// +// val foundJs = jsRegex.find(html)?.groupValues?.getOrNull(0) ?: return false +// try { +// rhino.evaluateString(scope, documentJs + foundJs, "JavaScript", 1, null) +// } catch (e: Exception) { +// } +// +// val hls = scope.get("hls", scope) as? ScriptableObject +// +// if (hls != null) { +// callback.invoke( +// ExtractorLink( +// this.name, +// this.name, +// hls["url"].toString(), +// this.mainUrl + "/", +// Qualities.Unknown.value, +// headers = mapOf("range" to "bytes=0-"), +// isM3u8 = true +// ) +// ) +// } else { + // Disgraceful fallback, but the js for Movies4Discord refuses to work correctly :( + loadLinksWithWebView(apiUrl, callback) +// } return true } } \ No newline at end of file