139原画多线程优化

This commit is contained in:
lushunming 2025-07-08 13:37:32 +08:00
parent e29f61d9b6
commit 3662843f46
5 changed files with 12 additions and 9 deletions

View File

@ -301,13 +301,14 @@ public class YunDrive {
String contentId = split[0]; String contentId = split[0];
String linkID = split[1]; String linkID = split[1];
playUrl = YunDrive.get().get4kVideoInfo(contentId, linkID); playUrl = YunDrive.get().get4kVideoInfo(contentId, linkID);
playUrl = ProxyVideo.buildCommonProxyUrl(playUrl, new HashMap<>());
} else { } else {
String contentId = split[0]; String contentId = split[0];
String linkID = split[1]; String linkID = split[1];
playUrl = YunDrive.get().fetchPlayUrl(contentId, linkID); playUrl = YunDrive.get().fetchPlayUrl(contentId, linkID);
} }
return Result.get().url(ProxyVideo.buildCommonProxyUrl(playUrl, new HashMap<>())).octet().header(getHeader()).string(); return Result.get().url(playUrl).octet().header(getHeader()).string();
} }
} }

View File

@ -1,6 +1,5 @@
package com.github.catvod.utils; package com.github.catvod.utils;
import android.os.Debug;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.TextUtils; import android.text.TextUtils;
@ -206,11 +205,14 @@ public class ProxyVideo {
} }
private static List<long[]> generatePart(Map<String, String> rangeObj, String total) { private static List<long[]> generatePart(Map<String, String> rangeObj, String total) {
long start = Long.parseLong(rangeObj.get("start"));
long end = StringUtils.isAllBlank(rangeObj.get("end")) ? start + 1024 * 1024 * 8 : Long.parseLong(rangeObj.get("end"));
long totalSize = Long.parseLong(total); long totalSize = Long.parseLong(total);
//超过10GB分块是30Mb不然是4MB
long partSize = totalSize > 8L * 1024L * 1024L * 1024L * 10L ? 1024 * 1024 * 8 * 30L : 1024 * 1024 * 8 * 4L;
long start = Long.parseLong(rangeObj.get("start"));
long end = StringUtils.isAllBlank(rangeObj.get("end")) ? start + partSize : Long.parseLong(rangeObj.get("end"));
end = Math.min(end, totalSize - 1); end = Math.min(end, totalSize - 1);
long length = end - start + 1; long length = end - start + 1;

Binary file not shown.

View File

@ -1 +1 @@
167365a584618d820c96a12fac7909b5 eab498637837fc40d738fee62168b41a

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;167365a584618d820c96a12fac7909b5", "spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;eab498637837fc40d738fee62168b41a",
"lives": [ "lives": [
{ {
"name": "电视直播", "name": "电视直播",