diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java b/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java index a4e85d24..aefadede 100644 --- a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java +++ b/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java @@ -228,15 +228,15 @@ final class HttpDFileInfoTask implements IInfoTask, Runnable { mTaskWrapper.setNewTask(true); mTaskWrapper.setSupportBP(false); end = true; - } else if (code == HttpURLConnection.HTTP_NOT_FOUND) { - failDownload(new AriaHTTPException(TAG, - String.format("任务下载失败,errorCode:404, url: %s", mEntity.getUrl())), false); - } else if (code == HttpURLConnection.HTTP_MOVED_TEMP + } else if (code == HttpURLConnection.HTTP_MOVED_TEMP || code == HttpURLConnection.HTTP_MOVED_PERM || code == HttpURLConnection.HTTP_SEE_OTHER || code == HttpURLConnection.HTTP_CREATED // 201 跳转 || code == 307) { handleUrlReTurn(conn, conn.getHeaderField("Location")); + } else if (code >= HttpURLConnection.HTTP_BAD_REQUEST) { + failDownload(new AriaHTTPException(TAG, + String.format("任务下载失败,errorCode:%s, url: %s", code, mEntity.getUrl())), false); } else { failDownload(new AriaHTTPException(TAG, String.format("任务下载失败,errorCode:%s, errorMsg: %s, url: %s", code, diff --git a/M3U8Component/src/main/java/com/arialyy/aria/m3u8/M3U8InfoTask.java b/M3U8Component/src/main/java/com/arialyy/aria/m3u8/M3U8InfoTask.java index 2d986cd8..df76f8a8 100644 --- a/M3U8Component/src/main/java/com/arialyy/aria/m3u8/M3U8InfoTask.java +++ b/M3U8Component/src/main/java/com/arialyy/aria/m3u8/M3U8InfoTask.java @@ -208,8 +208,8 @@ final public class M3U8InfoTask implements IInfoTask { || code == HttpURLConnection.HTTP_CREATED // 201 跳转 || code == 307) { handleUrlReTurn(conn, conn.getHeaderField("Location")); - } else if (code == HttpURLConnection.HTTP_NOT_FOUND) { - failDownload("404错误", false); + } else if (code >= HttpURLConnection.HTTP_BAD_REQUEST) { + failDownload("下载失败错误,错误码:" + code, false); } else { failDownload(String.format("不支持的响应,code: %s", code), true); } diff --git a/M3U8Component/src/main/java/com/arialyy/aria/m3u8/vod/M3U8VodLoader.java b/M3U8Component/src/main/java/com/arialyy/aria/m3u8/vod/M3U8VodLoader.java index fa3fb634..3ed9275a 100644 --- a/M3U8Component/src/main/java/com/arialyy/aria/m3u8/vod/M3U8VodLoader.java +++ b/M3U8Component/src/main/java/com/arialyy/aria/m3u8/vod/M3U8VodLoader.java @@ -135,10 +135,6 @@ final class M3U8VodLoader extends BaseM3U8Loader { } } - @Override public boolean isBreak() { - return super.isBreak() || isDestroy; - } - @Override protected void handleTask(Looper looper) { if (isBreak()) { return; diff --git a/app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8VodModule.java b/app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8VodModule.java index cf1859b9..ce39e0ce 100644 --- a/app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8VodModule.java +++ b/app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8VodModule.java @@ -38,7 +38,8 @@ public class M3U8VodModule extends BaseViewModule { //private final String defUrl = "https://cn7.kankia.com/hls/20200108/e1eaec074274c64fe46a3bdb5d2ba487/1578488360/index.m3u8"; //private final String defUrl = "https://youku.cdn7-okzy.com/20191213/16167_c3592a02/index.m3u8"; //private final String defUrl = "http://qn.shytong.cn/b83137769ff6b555/11b0c9970f9a3fa0.mp4.m3u8"; - private final String defUrl = "https://135zyv5.xw0371.com/2018/10/29/X05c7CG3VB91gi1M/playlist.m3u8"; + //private final String defUrl = "https://135zyv5.xw0371.com/2018/10/29/X05c7CG3VB91gi1M/playlist.m3u8"; + private final String defUrl = "https://fangao.qfxmj.com/video/20191111/dbf7e2aa0c5f42a8b040442b54c13e3a/cloudv-transfer/555555556nr593o75556r165q86n82n0_eb3da35b8f4442808756a6ddc8ec1372_0_3.m3u8?wsSecret=d5fb403512d4cd427f18858086b35ce4&wsTime=1582197537"; private final String filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath() //+ "/道士下山.ts";