增加立即恢复任务的接口,正常来说,当执行队列满时,调用恢复任务接口,只能将任务放到缓存队列中。如果希望调用恢复接口,马上进入执行队列,需要调用resume(true)这个重载方法。
修复一个非分块模式下,无法恢复下载的问题 增加M3U8加密密钥的下载地址转换器 https://github.com/AriaLyy/Aria/issues/522
This commit is contained in:
@@ -26,6 +26,7 @@ import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.arialyy.aria.core.download.M3U8Entity;
|
||||
import com.arialyy.aria.core.inf.OnFileInfoCallback;
|
||||
import com.arialyy.aria.core.processor.IBandWidthUrlConverter;
|
||||
import com.arialyy.aria.core.processor.IKeyUrlConverter;
|
||||
import com.arialyy.aria.core.wrapper.AbsTaskWrapper;
|
||||
import com.arialyy.aria.core.wrapper.ITaskWrapper;
|
||||
import com.arialyy.aria.exception.M3U8Exception;
|
||||
@@ -127,7 +128,7 @@ final public class M3U8InfoThread implements Runnable {
|
||||
File indexFile = new File(indexPath);
|
||||
if (!indexFile.exists()) {
|
||||
FileUtil.createFile(indexPath);
|
||||
}else {
|
||||
} else {
|
||||
//FileUtil.deleteFile(indexPath);
|
||||
}
|
||||
fos = new FileOutputStream(indexFile);
|
||||
@@ -353,7 +354,14 @@ final public class M3U8InfoThread implements Runnable {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
URL url = ConnectionHelp.handleUrl(info.keyUrl, mHttpOption);
|
||||
|
||||
IKeyUrlConverter keyUrlConverter = mM3U8Option.getKeyUrlConverter();
|
||||
String keyUrl = info.keyUrl;
|
||||
if (keyUrlConverter != null) {
|
||||
keyUrl = keyUrlConverter.convert(keyUrl);
|
||||
}
|
||||
|
||||
URL url = ConnectionHelp.handleUrl(keyUrl, mHttpOption);
|
||||
conn = ConnectionHelp.handleConnection(url, mHttpOption);
|
||||
ConnectionHelp.setConnectParam(mHttpOption, conn);
|
||||
conn.setConnectTimeout(mConnectTimeOut);
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.arialyy.aria.m3u8;
|
||||
|
||||
import com.arialyy.aria.core.inf.ITaskOption;
|
||||
import com.arialyy.aria.core.processor.IBandWidthUrlConverter;
|
||||
import com.arialyy.aria.core.processor.IKeyUrlConverter;
|
||||
import com.arialyy.aria.core.processor.ILiveTsUrlConverter;
|
||||
import com.arialyy.aria.core.processor.ITsMergeHandler;
|
||||
import com.arialyy.aria.core.processor.IVodTsUrlConverter;
|
||||
@@ -103,6 +104,19 @@ public class M3U8TaskOption implements ITaskOption {
|
||||
*/
|
||||
private boolean generateIndexFile = false;
|
||||
|
||||
/**
|
||||
* 加密密钥的解密处理器
|
||||
*/
|
||||
private SoftReference<IKeyUrlConverter> keyUrlConverter;
|
||||
|
||||
public IKeyUrlConverter getKeyUrlConverter() {
|
||||
return keyUrlConverter == null ? null : keyUrlConverter.get();
|
||||
}
|
||||
|
||||
public void setKeyUrlConverter(IKeyUrlConverter keyUrlConverter) {
|
||||
this.keyUrlConverter = new SoftReference<>(keyUrlConverter);
|
||||
}
|
||||
|
||||
public boolean isGenerateIndexFile() {
|
||||
return generateIndexFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user