diff --git a/app/src/main/java/com/github/catvod/utils/DownloadMT.kt b/app/src/main/java/com/github/catvod/utils/DownloadMT.kt index 859b8932..70e49441 100644 --- a/app/src/main/java/com/github/catvod/utils/DownloadMT.kt +++ b/app/src/main/java/com/github/catvod/utils/DownloadMT.kt @@ -18,7 +18,7 @@ import java.util.Vector import kotlin.math.min object DownloadMT { - private val THREAD_NUM: Int = 64 + private var THREAD_NUM: Int = Runtime.getRuntime().availableProcessors() * 2 private val infos = mutableMapOf>(); @@ -157,8 +157,9 @@ object DownloadMT { val totalSize = total.toLong() //超过10GB,分块是80MB,不然是16MB val partSize = - if (totalSize > 8L * 1024L * 1024L * 1024L * 10L) 1024 * 1024 * 8 * 10L else 1024 * 1024 * 8 * 2L - + if (totalSize > 1024L * 1024L * 1024L * 10L) 1024 * 1024 * 8 * 10L else 1024 * 1024 * 8 * 2L + THREAD_NUM= + if (totalSize > 1024L * 1024L * 1024L * 10L) 64 else THREAD_NUM var start = rangeObj["start"]!!.toLong() var end = if (StringUtils.isAllBlank(rangeObj["end"])) start + partSize else rangeObj["end"]!!.toLong() diff --git a/jar/custom_spider.jar b/jar/custom_spider.jar index 1975a047..8614b570 100644 Binary files a/jar/custom_spider.jar and b/jar/custom_spider.jar differ diff --git a/jar/custom_spider.jar.md5 b/jar/custom_spider.jar.md5 index 1bccf9bf..7122f098 100644 --- a/jar/custom_spider.jar.md5 +++ b/jar/custom_spider.jar.md5 @@ -1 +1 @@ -ee0cb4c956adb3087217062681ce67a0 +1810f7f08ca50f55c2cffb49a2a1678d diff --git a/json/index.json b/json/index.json index 4a87b352..4b79381f 100644 --- a/json/index.json +++ b/json/index.json @@ -1,5 +1,5 @@ { - "spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;ee0cb4c956adb3087217062681ce67a0", + "spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;1810f7f08ca50f55c2cffb49a2a1678d", "lives": [ { "name": "电视直播", diff --git a/json/test.json b/json/test.json index 6bd64b27..35630a4e 100644 --- a/json/test.json +++ b/json/test.json @@ -1,5 +1,5 @@ { - "spider": "https://ghproxy.net/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadkt/jar/custom_spider.jar;md5;ee0cb4c956adb3087217062681ce67a0", + "spider": "https://ghproxy.net/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadkt/jar/custom_spider.jar;md5;1810f7f08ca50f55c2cffb49a2a1678d", "lives": [ { "name": "电视直播",