From 5ef54a80cdd1b3a8a1ae34a607510020e782146f Mon Sep 17 00:00:00 2001 From: hexated Date: Wed, 9 Nov 2022 09:34:31 +0700 Subject: [PATCH] add return if fail in sora --- SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 10f38522..d96da150 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -809,10 +809,14 @@ object SoraExtractor : SoraStream() { val id = script.third?.last() val type = script.third?.get(2) - val json = app.get( + val jsonResponse = app.get( "$vipAPI/movieDrama/get?id=${id}&category=${type}", headers = headers - ).parsedSafe()?.data?.episodeVo?.first { it.seriesNo == (episode ?: 0) } + ) + + if(!jsonResponse.isSuccessful) return + + val json = jsonResponse.parsedSafe()?.data?.episodeVo?.first { it.seriesNo == (episode ?: 0) } json?.definitionList?.apmap { video -> delay(1000)