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

View file

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