fixed Loklok image also added CloudflareKiller to Movierulzhd

This commit is contained in:
hexated 2022-09-15 16:28:36 +07:00
parent afa9af853e
commit 3a33b45ac6
5 changed files with 16 additions and 8 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 1
version = 2
cloudstream {

View File

@ -8,6 +8,7 @@ import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.SubtitleHelper
import com.lagradost.cloudstream3.utils.getQualityFromName
import kotlinx.coroutines.delay
class Loklok : MainAPI() {
override var name = "Loklok"
@ -36,11 +37,12 @@ class Loklok : MainAPI() {
private const val mainImageUrl = "https://images.weserv.nl"
}
private fun encode(input: String): String? = java.net.URLEncoder.encode(input, "utf-8")
private fun encode(input: String): String = java.net.URLEncoder.encode(input, "utf-8").replace("+", "%20")
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val home = ArrayList<HomePageList>()
for (i in 0..10) {
delay(500)
app.get("$apiUrl/homePage/getHome?page=$i", headers = headers)
.parsedSafe<Home>()?.data?.recommendItems
?.filterNot { it.homeSectionType == "BLOCK_GROUP" }

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 5
version = 6
cloudstream {

View File

@ -5,11 +5,12 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.network.CloudflareKiller
import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
class Movierulzhd : MainAPI() {
override var mainUrl = "https://movierulzhd.run"
override var mainUrl = "https://movierulzhd.biz"
override var name = "Movierulzhd"
override val hasMainPage = true
override var lang = "hi"
@ -27,11 +28,13 @@ class Movierulzhd : MainAPI() {
"$mainUrl/episodes/page/" to "Episode",
)
private val interceptor = CloudflareKiller()
override suspend fun getMainPage(
page: Int,
request: MainPageRequest
): HomePageResponse {
val document = app.get(request.data + page).document
val document = app.get(request.data + page, interceptor = interceptor).document
val home =
document.select("div.items.normal article, div#archive-content article").mapNotNull {
it.toSearchResult()
@ -71,7 +74,7 @@ class Movierulzhd : MainAPI() {
override suspend fun search(query: String): List<SearchResponse> {
val link = "$mainUrl/search/$query"
val document = app.get(link).document
val document = app.get(link, interceptor = interceptor).document
return document.select("div.result-item").map {
val title =
@ -85,7 +88,7 @@ class Movierulzhd : MainAPI() {
}
override suspend fun load(url: String): LoadResponse {
val document = app.get(url).document
val document = app.get(url, interceptor = interceptor).document
val title =
document.selectFirst("div.data > h1")?.text()?.trim().toString()
@ -200,7 +203,7 @@ class Movierulzhd : MainAPI() {
callback: (ExtractorLink) -> Unit
): Boolean {
val document = app.get(data).document
val document = app.get(data, interceptor = interceptor).document
val id = document.select("meta#dooplay-ajax-counter").attr("data-postid")
val type = if (data.contains("/movies/")) "movie" else "tv"

View File

@ -81,6 +81,9 @@ subprojects {
implementation("org.jsoup:jsoup:1.13.1") // html parser
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1")
implementation("io.karn:khttp-android:0.1.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") // html parser
//run JS
implementation("org.mozilla:rhino:1.7.14")
}
}