From f6594c16095b049ba7cac99a5826df0aed5d3d7e Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Mon, 5 Jun 2023 10:54:12 +0800 Subject: [PATCH] change: update check live video entrance --- hrp/internal/version/VERSION | 2 +- hrp/pkg/uixt/video_crawler.go | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 25f68b33..94d22ffc 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.3.4-beta-2306021752 \ No newline at end of file +v4.3.4-beta-2306051133 \ No newline at end of file diff --git a/hrp/pkg/uixt/video_crawler.go b/hrp/pkg/uixt/video_crawler.go index 24054a5d..fc0f87ea 100644 --- a/hrp/pkg/uixt/video_crawler.go +++ b/hrp/pkg/uixt/video_crawler.go @@ -209,13 +209,20 @@ type LiveCrawler struct { func (l *LiveCrawler) checkLiveVideo(texts OCRTexts) (enterPoint PointF, yes bool) { // 预览流入口:DY/KS - points, err := texts.FindTexts([]string{".*点击进入直播间"}, WithRegex(true)) + points, err := texts.FindTexts([]string{".*点击进入直播间"}, WithScope(0, 0.3, 1, 0.7), WithRegex(true)) + if err == nil { + return points[0].Center(), true + } + // 标签文案:直播中|直播卖货|直播团购 + points, err = texts.FindTexts([]string{"直播中|直播卖货|直播团购"}, + WithScope(0, 0.7, 0.5, 1), WithRegex(true)) if err == nil { return points[0].Center(), true } - // 预览流入口:KS - points, err = texts.FindTexts([]string{"和主播聊聊天.*"}, WithRegex(true)) + // 预览流入口:KS/KSLite + // 评论框文案:和主播聊聊天...|聊聊天... + points, err = texts.FindTexts([]string{".*聊聊天.*", "更多直播"}, WithRegex(true)) if err == nil { point := points[0].Center() enterPoint = PointF{