From d328bc638aac7c41b29ac0947504961127f17acd Mon Sep 17 00:00:00 2001 From: firelight <147925818+fire-light42@users.noreply.github.com> Date: Tue, 7 Jul 2026 12:45:05 +0000 Subject: [PATCH 1/2] Fix: Corrupted HSL files due to 404 --- .../kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt index aa4515b30..ccc102bbc 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt @@ -234,6 +234,10 @@ object M3u8Helper2 { body.close() if (tsData.isEmpty()) throw ErrorLoadingException("no data") + // Some sources respond with "error 404" or similar, this checks for small responses that + // looks like ascii + if (tsData.size < 128 && tsData.all { it >= 0 }) throw ErrorLoadingException("Ascii found instead of data") + return if (isEncrypted) { getDecrypted(encryptionData, tsData, encryptionIv, index) } else { From e7664b338524006610b037a7246ba8cb3d75d64f Mon Sep 17 00:00:00 2001 From: firelight <147925818+fire-light42@users.noreply.github.com> Date: Wed, 8 Jul 2026 17:28:47 +0000 Subject: [PATCH 2/2] Update M3u8Helper.kt --- .../kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt index ccc102bbc..d34f5f500 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/M3u8Helper.kt @@ -235,8 +235,8 @@ object M3u8Helper2 { if (tsData.isEmpty()) throw ErrorLoadingException("no data") // Some sources respond with "error 404" or similar, this checks for small responses that - // looks like ascii - if (tsData.size < 128 && tsData.all { it >= 0 }) throw ErrorLoadingException("Ascii found instead of data") + // looks like ASCII + if (tsData.size < 128 && tsData.all { it >= 0 }) throw ErrorLoadingException("ASCII found instead of data") return if (isEncrypted) { getDecrypted(encryptionData, tsData, encryptionIv, index)