Fix OlgplyProvider.kt

This commit is contained in:
Blatzar 2022-08-13 02:05:34 +02:00
parent 9ac618559d
commit 4c47ddd81f
2 changed files with 15 additions and 11 deletions

View File

@ -1,12 +1,12 @@
// use an integer for version numbers // use an integer for version numbers
version = 1 version = 2
cloudstream { cloudstream {
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum" description = "Uses TMDB"
// authors = listOf("Cloudburst") authors = listOf("Blatzar")
/** /**
* Status int as the following: * Status int as the following:
@ -17,6 +17,5 @@ cloudstream {
* */ * */
status = 1 // will be 3 if unspecified status = 1 // will be 3 if unspecified
iconUrl = "https://www.google.com/s2/favicons?domain=olgply.com&sz=24" iconUrl = "https://www.google.com/s2/favicons?domain=olgply.com&sz=24"
} }

View File

@ -27,11 +27,15 @@ class OlgplyProvider : TmdbProvider() {
// subtitleCallback: (SubtitleFile) -> Unit, // subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
println("URKKKKKKKKKK $url")
val foundVideo = WebViewResolver( val foundVideo = WebViewResolver(
Regex("""movies4discord""") Regex("""\.m3u8|i7njdjvszykaieynzsogaysdgb0hm8u1mzubmush4maopa4wde\.com""")
).resolveUsingWebView( ).resolveUsingWebView(
requestCreator("GET", url) requestCreator(
).first ?: return "GET", url, referer = "https://olgply.xyz/"
)
)
.first ?: return
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
@ -39,7 +43,8 @@ class OlgplyProvider : TmdbProvider() {
"Movies4Discord", "Movies4Discord",
foundVideo.url.toString(), foundVideo.url.toString(),
"", "",
Qualities.Unknown.value Qualities.Unknown.value,
true
) )
) )
} }
@ -58,13 +63,13 @@ class OlgplyProvider : TmdbProvider() {
val apiUrl = val apiUrl =
"https://olgply.xyz/${tmdbId}${mappedData.season?.let { "/$it" } ?: ""}${mappedData.episode?.let { "/$it" } ?: ""}" "https://olgply.xyz/${tmdbId}${mappedData.season?.let { "/$it" } ?: ""}${mappedData.episode?.let { "/$it" } ?: ""}"
val html = val html =
app.get(apiUrl).text app.get(apiUrl, referer = "https://olgply.xyz/").text
val rhino = Context.enter() val rhino = Context.enter()
rhino.optimizationLevel = -1 rhino.optimizationLevel = -1
val scope: Scriptable = rhino.initSafeStandardObjects() val scope: Scriptable = rhino.initSafeStandardObjects()
val documentJs = """ val documentJs = """
Plyr = function(){}; Plyr = function(){};
hlsPrototype = { hlsPrototype = {
loadSource(url) { loadSource(url) {
this.url = url; this.url = url;
@ -73,7 +78,7 @@ class OlgplyProvider : TmdbProvider() {
function Hls() {}; function Hls() {};
Hls.isSupported = function(){return true}; Hls.isSupported = function(){return true};
Hls.prototype = hlsPrototype; Hls.prototype = hlsPrototype;
Hls.prototype.constructor = Hls; Hls.prototype.constructor = Hls;