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 {
it.select("a").attr("href") to it.select("a").text()
}.find {
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.first.contains("$year")
if(season == null) {
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")