修复一个匿名内部类中的内存溢出的问题 https://github.com/AriaLyy/Aria/issues/705
m3u8密钥下载地址转换器增加ts列表的url地址https://github.com/AriaLyy/Aria/issues/718
This commit is contained in:
@@ -4,11 +4,23 @@ import androidx.test.runner.AndroidJUnit4
|
||||
import com.arialyy.aria.util.CommonUtil
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import java.net.URLDecoder
|
||||
import java.net.URLEncoder
|
||||
import kotlin.math.pow
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ApiTest {
|
||||
|
||||
@Test
|
||||
fun testAddChar(){
|
||||
var str = "\\\\+道+歉+信\u0026感 谢 信"
|
||||
str = str.replace("\\+".toRegex(), "%2B")
|
||||
println("========")
|
||||
println(str)
|
||||
println(URLEncoder.encode(str))
|
||||
println(URLDecoder.decode(str))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSpeed() {
|
||||
val speed = 1024.0.pow(4.0) * 2
|
||||
|
||||
@@ -311,8 +311,9 @@ public class M3U8VodDLoadActivity extends BaseActivity<ActivityM3u8VodBinding> {
|
||||
//.setMergeHandler(new TsMergeHandler());
|
||||
option.setUseDefConvert(false);
|
||||
option.setKeyUrlConverter(new KeyUrlConverter());
|
||||
option.setVodTsUrlConvert(new VodTsUrlConverter());
|
||||
option.setBandWidthUrlConverter(new BandWidthUrlConverter());
|
||||
option.setUseDefConvert(true);
|
||||
//option.setUseDefConvert(true);
|
||||
return option;
|
||||
}
|
||||
|
||||
@@ -329,18 +330,19 @@ public class M3U8VodDLoadActivity extends BaseActivity<ActivityM3u8VodBinding> {
|
||||
@Override public List<String> convert(String m3u8Url, List<String> tsUrls) {
|
||||
Uri uri = Uri.parse(m3u8Url);
|
||||
//String parentUrl = "http://devimages.apple.com/iphone/samples/bipbop/gear1/";
|
||||
String parentUrl = "http://youku.cdn7-okzy.com/20200123/16815_fbe419ed/1000k/hls/";
|
||||
//String parentUrl = "http://youku.cdn7-okzy.com/20200123/16815_fbe419ed/1000k/hls/";
|
||||
//String parentUrl = "http://" + uri.getHost() + "/gear1/";
|
||||
//int index = m3u8Url.lastIndexOf("/");
|
||||
//String parentUrl = m3u8Url.substring(0, index + 1);
|
||||
//String parentUrl = "https://v1.szjal.cn/20190819/Ql6UD1od/";
|
||||
//String parentUrl = "http://" + uri.getHost() + "/";
|
||||
List<String> newUrls = new ArrayList<>();
|
||||
for (String url : tsUrls) {
|
||||
newUrls.add(parentUrl + url);
|
||||
}
|
||||
//List<String> newUrls = new ArrayList<>();
|
||||
//for (String url : tsUrls) {
|
||||
// newUrls.add(parentUrl + url);
|
||||
//}
|
||||
|
||||
return newUrls;
|
||||
//return newUrls;
|
||||
return tsUrls;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ public class M3U8VodModule extends BaseViewModule {
|
||||
// m3u8测试集合:http://www.voidcn.com/article/p-snaliarm-ct.html
|
||||
//private final String defUrl = "https://www.gaoya123.cn/2019/1557993797897.m3u8";
|
||||
// 多码率地址:
|
||||
private final String defUrl = "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8";
|
||||
//private final String defUrl = "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8";
|
||||
private final String defUrl = "http://mgjx.awu1k.cn:8000/parse/player.m3u8?target=eb2d3ca5198516269cf356463be86573";
|
||||
//private final String defUrl = "http://youku.cdn7-okzy.com/20200123/16815_fbe419ed/index.m3u8";
|
||||
|
||||
//private final String defUrl = "https://cn7.kankia.com/hls/20200108/e1eaec074274c64fe46a3bdb5d2ba487/1578488360/index.m3u8";
|
||||
|
||||
Reference in New Issue
Block a user