fix(AnimeWorld): try different bypass method

This commit is contained in:
darkdemon 2022-12-05 23:11:53 +05:30
parent d9771a0ac4
commit dad0898e0a
No known key found for this signature in database
GPG Key ID: 698A958D1F0F2899
2 changed files with 11 additions and 27 deletions

View File

@ -1,4 +1,4 @@
version = 2
version = 3
cloudstream {

View File

@ -1,12 +1,12 @@
package com.darkdemon
import android.util.Log
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.extractors.XStreamCdn
import com.lagradost.cloudstream3.utils.*
import com.lagradost.nicehttp.JsonAsString
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.nodes.Element
class AnimeWorldProvider : MainAPI() { // all providers must be an instance of MainAPI
@ -71,9 +71,8 @@ class AnimeWorldProvider : MainAPI() { // all providers must be an instance of M
override suspend fun load(url: String): LoadResponse? {
val document = app.get(url).document
if (document.select("h2.title").text().contains("Skip Ad")) {
val link = document.selectFirst(".glass-button")!!.attr("onclick").substringAfter("'")
.substringBefore("'")
bypassRockLinks(link)
//val link = document.selectFirst(".glass-button")!!.attr("onclick").substringAfter("'") .substringBefore("'")
bypassRockLinks()
}
val title = document.selectFirst(".entry-title")?.text()?.trim() ?: return null
val poster = fixUrlNull(document.selectFirst(".post-thumbnail img")?.attr("src"))
@ -152,9 +151,8 @@ class AnimeWorldProvider : MainAPI() { // all providers must be an instance of M
val document = app.get(data).document
Log.d("test", document.select("h2.title").text())
if (document.select("h2.title").text().contains("Skip Ad")) {
val link = document.selectFirst(".glass-button")!!.attr("onclick").substringAfter("'")
.substringBefore("'")
bypassRockLinks(link)
//val link = document.selectFirst(".glass-button")!!.attr("onclick").substringAfter("'") .substringBefore("'")
bypassRockLinks()
} else {
val langPair = document.select(".aa-tbs li").associate {
it.select("a").attr("href").replace("#", "") to it.select(".server").text()
@ -186,25 +184,11 @@ class AnimeWorldProvider : MainAPI() { // all providers must be an instance of M
return true
}
private suspend fun bypassRockLinks(link: String) {
val apiUrl = "https://api.emilyx.in/api/bypass"
val type =
if (link.contains("rocklinks")) "rocklinks" else if (link.contains("dulink")) "dulink" else ""
val values = mapOf("type" to type, "url" to link)
val json = mapper.writeValueAsString(values)
val response = app.post(
url = apiUrl,
headers = mapOf(
"Content-Type" to "application/json"
),
json = JsonAsString(json)
).parsed<Response>().url
private suspend fun bypassRockLinks() {
val response =
"$mainUrl/api/final.php?key=JDJ5JDEwJHZVRnpRM3FrdklMRUZMM1g1aW9oL2VkQzVwM3NpQkxvdE10TktCNko4RXFheFViTmtMdUdP"
app.get(response).document
}
data class Response(
@JsonProperty("url") var url: String
)
}
class Vanfem : XStreamCdn() {