修复iv不存在时,索引文件异常的问题, https://github.com/AriaLyy/Aria/issues/780

pull/907/head
laoyuyu 4 years ago
parent 68c992962b
commit 0152187aa8
  1. 1
      DEV_LOG.md
  2. 18
      M3U8Component/src/main/java/com/arialyy/aria/m3u8/BaseM3U8Loader.java

@ -1,6 +1,7 @@
## 开发日志 ## 开发日志
+ v_3.8.15 + v_3.8.15
- 修复不支持断点的连接下载失败问题,https://github.com/AriaLyy/Aria/issues/771 - 修复不支持断点的连接下载失败问题,https://github.com/AriaLyy/Aria/issues/771
- 修复iv不存在时,索引文件异常的问题,https://github.com/AriaLyy/Aria/issues/780
+ v_3.8.14 (2020/9/23) + v_3.8.14 (2020/9/23)
- 修复spi机制的兼容问题,https://github.com/AriaLyy/Aria/issues/743 - 修复spi机制的兼容问题,https://github.com/AriaLyy/Aria/issues/743
- 增加路径不可以写的判断,下载时,如果路径不可写,将执行失败回调 https://github.com/AriaLyy/Aria/issues/750 - 增加路径不可以写的判断,下载时,如果路径不可写,将执行失败回调 https://github.com/AriaLyy/Aria/issues/750

@ -95,9 +95,21 @@ public abstract class BaseM3U8Loader extends AbsNormalLoader<DTaskWrapper> {
i++; i++;
} else if (line.startsWith("#EXT-X-KEY")) { } else if (line.startsWith("#EXT-X-KEY")) {
M3U8Entity m3U8Entity = getEntity().getM3U8Entity(); M3U8Entity m3U8Entity = getEntity().getM3U8Entity();
String keyInfo = String.format("#EXT-X-KEY:METHOD=%s,URI=\"%s\",IV=%s\r\n", m3U8Entity.method, StringBuilder sb = new StringBuilder("#EXT-X-KEY:");
m3U8Entity.keyPath, m3U8Entity.iv); sb.append("METHOD=").append(m3U8Entity.method);
bytes = keyInfo.getBytes(Charset.forName("UTF-8")); sb.append(",URI=\"").append(m3U8Entity.keyPath).append("\"");
if (!TextUtils.isEmpty(m3U8Entity.iv)) {
sb.append(",IV=").append(m3U8Entity.iv);
}
if (!TextUtils.isEmpty(m3U8Entity.keyFormat)) {
sb.append(",KEYFORMAT=\"").append(m3U8Entity.keyFormat).append("\"");
sb.append(",KEYFORMATVERSIONS=\"")
.append(TextUtils.isEmpty(m3U8Entity.keyFormatVersion) ? "1"
: m3U8Entity.keyFormatVersion)
.append("\"");
}
sb.append("\r\n");
bytes = sb.toString().getBytes(Charset.forName("UTF-8"));
} else { } else {
bytes = line.concat("\r\n").getBytes(Charset.forName("UTF-8")); bytes = line.concat("\r\n").getBytes(Charset.forName("UTF-8"));
} }

Loading…
Cancel
Save