天翼Bug

This commit is contained in:
lushunming 2025-04-24 14:28:00 +08:00
parent 58d107fade
commit 220594da3e
6 changed files with 36 additions and 9 deletions

View File

@ -52,24 +52,51 @@ public class TianyiApi {
JsonObject obj = Json.safeObject(token);
//初始化CookieJar
if (Objects.nonNull(obj)) {
tianYiHandler.setCookie(obj);
tianYiHandler.setCookie(obj);
}
}
if (cookieJar.getCookieStore().size() == 0) {
SpiderDebug.log("CookieJar为空");
if (!isCookieValid()) {
SpiderDebug.log("CookieJar不合法,请重新登录");
tianYiHandler.startScan();
}
getUserSizeInfo();
this.sessionKey = getUserBriefInfo();
}
/**
* 判断cookie是否为空或者SSon为空那就需要重新登陆
*
* @return
*/
private boolean isCookieValid() {
if (cookieJar.getCookieStore().size() == 0) {
SpiderDebug.log("CookieJar为空");
return false;
} else {
for (String key : cookieJar.getCookieStore().keySet()) {
Map<String, String> cookieMap = cookieJar.getCookieStore().get(key);
for (String k : cookieMap.keySet()) {
String cookieobj = cookieMap.get(k);
if (k.equals("SSON") && StringUtils.isNoneBlank(cookieobj)) {
SpiderDebug.log("SSON 不为空");
return true;
}
}
}
}
SpiderDebug.log("CookieJar 不合法,重新登录");
return false;
}
private Map<String, String> getHeaders() {
Map<String, String> headers = new HashMap<>();
headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/2.5.20 Chrome/100.0.4896.160 Electron/18.3.5.4-b478491100 Safari/537.36 Channel/pckk_other_ch");
headers.put("Content-Type", "application/x-www-form-urlencoded");
headers.put("accept", "application/json;charset=UTF-8");
headers.put("cookie", cookieJar.loadForRequest("https://cloud.189.cn/api/portal/getNewVlcVideoPlayUrl.action"));
headers.put("cookie", cookieJar.loadForRequest("https://cloud.189.cn/api/portal/getNewVlcVideoPlayUrl.action"));
if (StringUtils.isNotBlank(sessionKey)) {
headers.put("sessionKey", sessionKey);
@ -145,7 +172,7 @@ public class TianyiApi {
header.remove("Content-Type");
header.put("Cookie", cookieJar.loadForRequest("https://cloud.189.cn/api/portal/getNewVlcVideoPlayUrl.action"));
header.put("Cookie", cookieJar.loadForRequest("https://cloud.189.cn/api/portal/getNewVlcVideoPlayUrl.action"));
return Result.get().url(ProxyVideo.buildCommonProxyUrl(playUrl, header)).octet().header(header).string();
}

Binary file not shown.

View File

@ -1 +1 @@
5e2bbd9978de504a5acc3549d5bc4395
35779f941df038cdb78a3ca45bdfe22b

View File

@ -1,5 +1,5 @@
{
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;5e2bbd9978de504a5acc3549d5bc4395",
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;35779f941df038cdb78a3ca45bdfe22b",
"lives": [
{
"name": "电视直播",

View File

@ -1,5 +1,5 @@
{
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;5e2bbd9978de504a5acc3549d5bc4395",
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;35779f941df038cdb78a3ca45bdfe22b",
"lives": [
{
"name": "直播ipv6",

View File

@ -1,5 +1,5 @@
{
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;5e2bbd9978de504a5acc3549d5bc4395",
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;35779f941df038cdb78a3ca45bdfe22b",
"lives": [
{
"name": "直播ipv6",