Compare commits

...

2 commits

Author SHA1 Message Date
firelight
e7664b3385
Update M3u8Helper.kt 2026-07-08 17:28:47 +00:00
firelight
d328bc638a
Fix: Corrupted HSL files due to 404 2026-07-07 12:45:05 +00:00

View file

@ -234,6 +234,10 @@ object M3u8Helper2 {
body.close() body.close()
if (tsData.isEmpty()) throw ErrorLoadingException("no data") 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) { return if (isEncrypted) {
getDecrypted(encryptionData, tsData, encryptionIv, index) getDecrypted(encryptionData, tsData, encryptionIv, index)
} else { } else {