mirror of
https://github.com/daarkdemon/cs-darkdemon-extensions.git
synced 2024-08-14 23:57:20 +00:00
fix(AnimeWorld): try different bypass method
This commit is contained in:
parent
d9771a0ac4
commit
dad0898e0a
2 changed files with 11 additions and 27 deletions
|
@ -1,4 +1,4 @@
|
|||
version = 2
|
||||
version = 3
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue