From fb3576ea52e12f5c1a71f0bbcc1ad72f70dabea5 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Fri, 21 Apr 2023 19:56:17 +0800 Subject: [PATCH] fix video download (#453) --- .../com/lagradost/cloudstream3/utils/VideoDownloadManager.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt index 2902b76b..c18ff48f 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt @@ -1388,7 +1388,7 @@ object VideoDownloadManager { } } - if (link.isM3u8 || URI(link.url).path.endsWith(".m3u8")) { + if (link.isM3u8 || URL(link.url).path.endsWith(".m3u8")) { val startIndex = if (tryResume) { context.getKey( KEY_DOWNLOAD_INFO, @@ -1474,6 +1474,8 @@ object VideoDownloadManager { if (connectionResult != null && connectionResult > 0) { // SUCCESS removeKey(KEY_RESUME_PACKAGES, id.toString()) break + } else if (index == item.links.lastIndex) { + downloadStatusEvent.invoke(Pair(id, DownloadType.IsFailed)) } } } catch (e: Exception) {