Skip to content

Commit 1d0ce78

Browse files
Last Sync: 2025-12-24 04:10 (Mobile)
1 parent 5aff6ca commit 1d0ce78

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

AnimeSailProvider/src/main/kotlin/com/hexated/AnimeSailProvider.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import com.lagradost.cloudstream3.*
44
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
55
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
66
import com.lagradost.cloudstream3.amap
7-
import com.lagradost.cloudstream3.mvvm.safeApiCall
87
import com.lagradost.cloudstream3.utils.ExtractorLink
98
import com.lagradost.cloudstream3.utils.ExtractorLinkType
109
import com.lagradost.cloudstream3.utils.INFER_TYPE
@@ -150,10 +149,12 @@ class AnimeSailProvider : MainAPI() {
150149

151150
val document = request(data).document
152151

152+
// Menggunakan amap untuk proses async per item
153153
document.select(".mobius > .mirror > option").amap {
154-
safeApiCall {
154+
// Gunakan try-catch biasa, bukan safeApiCall, agar support suspend function
155+
try {
155156
val dataEm = it.attr("data-em")
156-
if (dataEm.isBlank()) return@safeApiCall
157+
if (dataEm.isBlank()) return@amap
157158

158159
// Decode base64 link
159160
val iframe = fixUrl(
@@ -237,13 +238,15 @@ class AnimeSailProvider : MainAPI() {
237238
}
238239

239240
// SKIP BAD SOURCES
240-
iframe.contains("/fichan/") || iframe.contains("/blogger/") -> return@safeApiCall
241+
iframe.contains("/fichan/") || iframe.contains("/blogger/") -> return@amap
241242

242243
// 4. FALLBACK (Sisanya biarkan Extractor bawaan CS menangani)
243244
else -> {
244245
loadFixedExtractor(iframe, quality, mainUrl, subtitleCallback, callback)
245246
}
246247
}
248+
} catch (e: Exception) {
249+
e.printStackTrace()
247250
}
248251
}
249252
return true
@@ -256,7 +259,7 @@ class AnimeSailProvider : MainAPI() {
256259
subtitleCallback: (SubtitleFile) -> Unit,
257260
callback: (ExtractorLink) -> Unit
258261
) {
259-
// RunBlocking dihapus agar tidak nge-freeze UI saat load banyak link
262+
// RunBlocking dihapus, langsung panggil fungsi suspend loadExtractor
260263
loadExtractor(url, referer, subtitleCallback) { link ->
261264
callback.invoke(
262265
newExtractorLink(

0 commit comments

Comments
 (0)