修复40x错误,会继续重试并且无法重试成功的问题 https://github.com/AriaLyy/Aria/issues/619

pull/631/head
laoyuyu 5 years ago
parent ad58dce395
commit ea2e27f3e9
  1. 6
      HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java
  2. 4
      M3U8Component/src/main/java/com/arialyy/aria/m3u8/M3U8InfoTask.java
  3. 4
      M3U8Component/src/main/java/com/arialyy/aria/m3u8/vod/M3U8VodLoader.java
  4. 3
      app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8VodModule.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
|| 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,

@ -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);
}

@ -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;

@ -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";

Loading…
Cancel
Save