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..d34f5f500 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 {