smol tweak

This commit is contained in:
hexated 2022-12-31 07:06:18 +07:00
parent c4a7bf97d6
commit bd82ba5d51

View file

@ -1596,7 +1596,11 @@ object SoraExtractor : SoraStream() {
val matchMedia = doc.select("article.mh-loop-item").map { val matchMedia = doc.select("article.mh-loop-item").map {
it.select("a").attr("href") to it.select("a").text() it.select("a").attr("href") to it.select("a").text()
}.find { }.find {
if(season == null) {
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.first.contains("$year") it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.first.contains("$year")
} else {
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.second.contains(Regex("(?i)(Season\\s?$season)|(S0?$season)"))
}
} }
val mediaLink = app.get(matchMedia?.first ?: return).document.selectFirst("a#jake1")?.attr("href") val mediaLink = app.get(matchMedia?.first ?: return).document.selectFirst("a#jake1")?.attr("href")