百度扫码登录优化
This commit is contained in:
parent
932e6ebab5
commit
f7b13b1b21
|
|
@ -10,7 +10,6 @@ import com.github.catvod.utils.Util
|
||||||
import com.github.catvod.utils.Util.MEDIA
|
import com.github.catvod.utils.Util.MEDIA
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.atomic.AtomicInteger
|
|
||||||
|
|
||||||
object BaiduDrive {
|
object BaiduDrive {
|
||||||
private val cache = mutableMapOf<String, String>();
|
private val cache = mutableMapOf<String, String>();
|
||||||
|
|
@ -39,14 +38,11 @@ object BaiduDrive {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun processShareLinks(urls: List<String>): Pair<List<String>, List<String>> {
|
fun processShareLinks(urls: List<String>): Pair<List<String>, List<String>> {
|
||||||
val retry = AtomicInteger(3)
|
|
||||||
//首先确保cookie不为空
|
//首先确保cookie不为空
|
||||||
if (cookies.isEmpty() && retry.get() > 0) {
|
if (cookies.isEmpty()) {
|
||||||
BaiDuYunHandler.get().startScan()
|
BaiDuYunHandler.get().startScan()
|
||||||
cookies = BaiDuYunHandler.get().token
|
cookies = BaiDuYunHandler.get().token
|
||||||
Thread.sleep(10000)
|
|
||||||
retry.decrementAndGet()
|
|
||||||
processShareLinks(urls)
|
|
||||||
}
|
}
|
||||||
if (urls.isEmpty()) return emptyList<String>() to emptyList()
|
if (urls.isEmpty()) return emptyList<String>() to emptyList()
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
11bbc41a3dab2b417fb77d70c031dabf
|
53bfcd21daf6443ac9c0922ef11a640c
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;11bbc41a3dab2b417fb77d70c031dabf",
|
"spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;53bfcd21daf6443ac9c0922ef11a640c",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "电视直播",
|
"name": "电视直播",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue