removed CloudflareKiller from Otakudesu

This commit is contained in:
hexated 2022-09-24 01:36:35 +07:00
parent 8e043643b5
commit 398359c077
2 changed files with 18 additions and 11 deletions

View file

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

View file

@ -8,7 +8,6 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
import java.util.ArrayList
class OtakudesuProvider : MainAPI() {
override var mainUrl = "https://otakudesu.video"
@ -24,7 +23,7 @@ class OtakudesuProvider : MainAPI() {
)
companion object {
private val interceptor = CloudflareKiller()
// private val interceptor = CloudflareKiller()
fun getType(t: String): TvType {
return if (t.contains("OVA") || t.contains("Special")) TvType.OVA
@ -50,7 +49,9 @@ class OtakudesuProvider : MainAPI() {
page: Int,
request: MainPageRequest
): HomePageResponse {
val document = app.get(request.data + page, interceptor = interceptor).document
val document = app.get(request.data + page
// , interceptor = interceptor
).document
val home = document.select("div.venz > ul > li").mapNotNull {
it.toSearchResult()
}
@ -66,14 +67,16 @@ class OtakudesuProvider : MainAPI() {
return newAnimeSearchResponse(title, href, TvType.Anime) {
this.posterUrl = posterUrl
addSub(epNum)
posterHeaders = interceptor.getCookieHeaders(url).toMap()
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
}
}
override suspend fun search(query: String): List<SearchResponse> {
val link = "$mainUrl/?s=$query&post_type=anime"
val document = app.get(link, interceptor = interceptor).document
val document = app.get(link
// , interceptor = interceptor
).document
return document.select("ul.chivsrc > li").map {
val title = it.selectFirst("h2 > a")!!.ownText().trim()
@ -81,14 +84,16 @@ class OtakudesuProvider : MainAPI() {
val posterUrl = it.selectFirst("img")!!.attr("src").toString()
newAnimeSearchResponse(title, href, TvType.Anime) {
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).document
val document = app.get(url
// , interceptor = interceptor
).document
val title = document.selectFirst("div.infozingle > p:nth-child(1) > span")?.ownText()
?.replace(":", "")?.trim().toString()
@ -123,7 +128,7 @@ class OtakudesuProvider : MainAPI() {
val recPosterUrl = it.selectFirst("a > img")?.attr("src").toString()
newAnimeSearchResponse(recName, recHref, TvType.Anime) {
this.posterUrl = recPosterUrl
posterHeaders = interceptor.getCookieHeaders(url).toMap()
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
}
}
@ -136,7 +141,7 @@ class OtakudesuProvider : MainAPI() {
plot = description
this.tags = tags
this.recommendations = recommendations
posterHeaders = interceptor.getCookieHeaders(url).toMap()
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
}
}
@ -158,7 +163,9 @@ class OtakudesuProvider : MainAPI() {
callback: (ExtractorLink) -> Unit
): Boolean {
val document = app.get(data, interceptor = interceptor).document
val document = app.get(data
// , interceptor = interceptor
).document
val scriptData = document.select("script").last()?.data()
val token = scriptData?.substringAfter("{action:\"")?.substringBefore("\"}").toString()