added CF into Movierulzhd

This commit is contained in:
hexated 2022-11-04 13:43:08 +07:00
parent 5511b17389
commit 21ed547897
2 changed files with 12 additions and 11 deletions

View file

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

View file

@ -31,14 +31,15 @@ class Movierulzhd : MainAPI() {
"$mainUrl/episodes/page/" to "Episode",
)
// private val interceptor = CloudflareKiller()
private val interceptor = CloudflareKiller()
override suspend fun getMainPage(
page: Int,
request: MainPageRequest
): HomePageResponse {
val document = app.get(request.data + page,
// interceptor = interceptor
interceptor = interceptor,
referer = mainUrl
).document
val home =
document.select("div.items.normal article, div#archive-content article").mapNotNull {
@ -73,7 +74,7 @@ class Movierulzhd : MainAPI() {
return newMovieSearchResponse(title, href, TvType.Movie) {
this.posterUrl = posterUrl
this.quality = quality
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
}
}
@ -81,7 +82,7 @@ class Movierulzhd : MainAPI() {
override suspend fun search(query: String): List<SearchResponse> {
val link = "$mainUrl/search/$query"
val document = app.get(link
// , interceptor = interceptor
, interceptor = interceptor
).document
return document.select("div.result-item").map {
@ -91,14 +92,14 @@ class Movierulzhd : MainAPI() {
val posterUrl = it.selectFirst("img")!!.attr("src").toString()
newMovieSearchResponse(title, href, TvType.TvSeries) {
this.posterUrl = posterUrl
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
posterHeaders = interceptor.getCookieHeaders(url).toMap()
}
}
}
override suspend fun load(url: String): LoadResponse {
val document = app.get(url
// , interceptor = interceptor
, interceptor = interceptor
).document
val title =
@ -126,7 +127,7 @@ class Movierulzhd : MainAPI() {
val recPosterUrl = it.selectFirst("img")?.attr("src").toString()
newTvSeriesSearchResponse(recName, recHref, TvType.TvSeries) {
this.posterUrl = recPosterUrl
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
posterHeaders = interceptor.getCookieHeaders(url).toMap()
}
}
@ -156,7 +157,7 @@ class Movierulzhd : MainAPI() {
addActors(actors)
this.recommendations = recommendations
addTrailer(trailer)
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
posterHeaders = interceptor.getCookieHeaders(url).toMap()
}
} else {
newMovieLoadResponse(title, url, TvType.Movie, url) {
@ -168,7 +169,7 @@ class Movierulzhd : MainAPI() {
addActors(actors)
this.recommendations = recommendations
addTrailer(trailer)
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
posterHeaders = interceptor.getCookieHeaders(url).toMap()
}
}
}
@ -218,7 +219,7 @@ class Movierulzhd : MainAPI() {
): Boolean {
val document = app.get(data
// , interceptor = interceptor
, interceptor = interceptor
).document
val id = document.select("meta#dooplay-ajax-counter").attr("data-postid")
val type = if (data.contains("/movies/")) "movie" else "tv"