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 // use an integer for version numbers
version = 2 version = 3
cloudstream { cloudstream {

View file

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