From 453e68da55ae4585938f4f1bc73f23e27aa0ecfd Mon Sep 17 00:00:00 2001 From: hexated Date: Mon, 20 Feb 2023 16:35:06 +0700 Subject: [PATCH] sora: fixed Gomovies --- .../main/kotlin/com/hexated/SoraExtractor.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index ff13dfd5..26b0f92d 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -2492,14 +2492,20 @@ object SoraExtractor : SoraStream() { it.attr("data-year"), it.select("a").attr("href") ) - }.find { - if (season == null) { - (it.first.equals(title, true) || it.first.equals( - "$title ($year)", - true - )) && it.second.equals("$year") + }.let { el -> + if(el.size == 1) { + el.firstOrNull() } else { - it.first.equals("$title - Season $season", true) && it.second.equals("$year") + el.find { + if (season == null) { + (it.first.equals(title, true) || it.first.equals( + "$title ($year)", + true + )) && it.second.equals("$year") + } else { + it.first.equals("$title - Season $season", true) + } + } } } ?: return