From 1c68932238e37107c9d52c90f0e85df4a34be4e3 Mon Sep 17 00:00:00 2001 From: Bravepping <1131302745@qq.com> Date: Tue, 22 Apr 2025 18:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ping/study/controller/tx/LiveInfoController.java | 1 + src/main/java/com/ping/study/service/tx/LiveInfoService.java | 3 +-- .../com/ping/study/service/tx/TxSportTokenRefreshService.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ping/study/controller/tx/LiveInfoController.java b/src/main/java/com/ping/study/controller/tx/LiveInfoController.java index 60b9328..ccc7e3f 100644 --- a/src/main/java/com/ping/study/controller/tx/LiveInfoController.java +++ b/src/main/java/com/ping/study/controller/tx/LiveInfoController.java @@ -22,6 +22,7 @@ public class LiveInfoController { @GetMapping("/live/{cnlid}") public String getLiveInfo(@PathVariable String cnlid) throws Exception { + log.info("执行查询直播cnlid: {}", cnlid); return liveInfoService.getLiveInfo(cnlid); } diff --git a/src/main/java/com/ping/study/service/tx/LiveInfoService.java b/src/main/java/com/ping/study/service/tx/LiveInfoService.java index c9baf45..d5f4ae4 100644 --- a/src/main/java/com/ping/study/service/tx/LiveInfoService.java +++ b/src/main/java/com/ping/study/service/tx/LiveInfoService.java @@ -77,7 +77,7 @@ public class LiveInfoService { // 2. 打印请求头(Cookie) String cookie = getCookieForRequest(); - log.info("请求头 Cookie: {}", cookie); +// log.info("请求头 Cookie: {}", cookie); // 3. 发起请求 String res = webClient.get() @@ -128,7 +128,6 @@ public class LiveInfoService { } } } - log.info("提取到的播放URL数量: {}", urls.size()); return urls; } diff --git a/src/main/java/com/ping/study/service/tx/TxSportTokenRefreshService.java b/src/main/java/com/ping/study/service/tx/TxSportTokenRefreshService.java index 083a167..e2e917e 100644 --- a/src/main/java/com/ping/study/service/tx/TxSportTokenRefreshService.java +++ b/src/main/java/com/ping/study/service/tx/TxSportTokenRefreshService.java @@ -35,6 +35,7 @@ public class TxSportTokenRefreshService { log.error("Redis 中未找到 Cookie,无法刷新"); return false; } + log.info("旧的cookie:{}",cookieJson); Map baseCookies = objectMapper.readValue(cookieJson, new TypeReference<>() {}); String cookieHeader = buildCookieHeader(baseCookies); @@ -57,7 +58,6 @@ public class TxSportTokenRefreshService { Long.parseLong(data.path("tokenTTL").asText()), TimeUnit.SECONDS ); - return true; } catch (Exception e) { log.error("刷新 Cookie 失败", e); @@ -82,7 +82,7 @@ public class TxSportTokenRefreshService { } // 可选:定时自动刷新(你可以打开) - @Scheduled(fixedRate = 3600000) + @Scheduled(fixedRate = 5400000) // 每90分钟执行一次 public void scheduledRefresh() { log.info("定时刷新Cookie"); if (!refreshCookies()) {