small fix

This commit is contained in:
sora 2023-07-20 23:07:46 +07:00
parent ee302555a5
commit 8b9a58a5a0
2 changed files with 7 additions and 7 deletions

View file

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

View file

@ -155,8 +155,8 @@ class Nekopoi : MainAPI() {
) to ele.selectFirst("a:contains(ouo)") ) to ele.selectFirst("a:contains(ouo)")
?.attr("href") ?.attr("href")
}.filter { it.first != Qualities.P360.value }.map { }.filter { it.first != Qualities.P360.value }.map {
val bypassedAds = bypassMirrored(bypassOuo(it.second ?: return@map) ?: return@map) val bypassedAds = bypassMirrored(bypassOuo(it.second))
bypassedAds.apmap ads@{ adsLink -> bypassedAds.amap ads@{ adsLink ->
loadExtractor( loadExtractor(
fixEmbed(adsLink) ?: return@ads, fixEmbed(adsLink) ?: return@ads,
"$mainUrl/", "$mainUrl/",
@ -225,8 +225,8 @@ class Nekopoi : MainAPI() {
return res.headers["location"] return res.headers["location"]
} }
private suspend fun bypassMirrored(url: String): List<String?> { private suspend fun bypassMirrored(url: String?): List<String?> {
val request = app.get(url) val request = app.get(url ?: return emptyList())
val hostUrl = getBaseUrl(request.url) val hostUrl = getBaseUrl(request.url)
var nextUrl = request.document.selectFirst("div.row div.centered a")?.attr("href") var nextUrl = request.document.selectFirst("div.row div.centered a")?.attr("href")
nextUrl = app.get(nextUrl ?: return emptyList()).text.substringAfter("\"GET\", \"") nextUrl = app.get(nextUrl ?: return emptyList()).text.substringAfter("\"GET\", \"")
@ -234,11 +234,11 @@ class Nekopoi : MainAPI() {
return app.get(fixUrl(nextUrl, hostUrl)).document.select("table.hoverable tbody tr") return app.get(fixUrl(nextUrl, hostUrl)).document.select("table.hoverable tbody tr")
.filter { mirror -> .filter { mirror ->
!mirrorIsBlackList(mirror.selectFirst("img")?.attr("alt")) !mirrorIsBlackList(mirror.selectFirst("img")?.attr("alt"))
}.apmap { }.amap {
val fileLink = it.selectFirst("a")?.attr("href") val fileLink = it.selectFirst("a")?.attr("href")
app.get( app.get(
fixUrl( fixUrl(
fileLink.toString(), fileLink ?: return@amap null,
hostUrl hostUrl
) )
).document.selectFirst("div.code_wrap code")?.text() ).document.selectFirst("div.code_wrap code")?.text()