fix sora sources, fix #583 and more

This commit is contained in:
Olivia 2024-02-11 04:21:01 +07:00
parent d17d1e870a
commit 36d0a97580
9 changed files with 72 additions and 128 deletions

View file

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

View file

@ -7,7 +7,7 @@ import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
class OploverzProvider : MainAPI() {
override var mainUrl = "https://oploverz.guru"
override var mainUrl = "https://oploverz.gold"
override var name = "Oploverz"
override val hasMainPage = true
override var lang = "id"
@ -20,7 +20,6 @@ class OploverzProvider : MainAPI() {
)
companion object {
const val acefile = "https://acefile.co"
fun getType(t: String): TvType {
return if (t.contains("OVA", true) || t.contains("Special")) TvType.OVA
else if (t.contains("Movie", true)) TvType.AnimeMovie
@ -170,14 +169,14 @@ class OploverzProvider : MainAPI() {
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
).document.select("iframe").attr("src")
loadExtractor(fixedIframe(iframe), "$mainUrl/", subtitleCallback, callback)
loadExtractor(fixUrl(iframe), "$mainUrl/", subtitleCallback, callback)
}
},
{
document.select("div#download tr").map { el ->
document.select("div#download tr").apmap { el ->
el.select("a").apmap {
loadFixedExtractor(fixedIframe(it.attr("href")), el.select("strong").text(), "$mainUrl/", subtitleCallback, callback)
loadFixedExtractor(fixUrl(it.attr("href")), el.select("strong").text(), "$mainUrl/", subtitleCallback, callback)
}
}
}
@ -217,12 +216,4 @@ class OploverzProvider : MainAPI() {
}
}
private fun fixedIframe(url: String): String {
val id = Regex("""(?:/f/|/file/)(\w+)""").find(url)?.groupValues?.getOrNull(1)
return when {
url.startsWith(acefile) -> "${acefile}/player/$id"
else -> fixUrl(url)
}
}
}