feat: add live type

This commit is contained in:
lilong.129
2023-08-28 23:16:05 +08:00
parent 771991d79b
commit 5b0f158d29
3 changed files with 13 additions and 17 deletions
+2 -6
View File
@@ -178,9 +178,6 @@ func (vc *VideoCrawler) startLiveCrawler(enterPoint PointF) error {
}
swipeFinishTime := time.Now()
// wait for live video loading
time.Sleep(5 * time.Second)
liveRoom, err := vc.getCurrentLiveRoom()
if err != nil {
return errors.Wrap(err, "get current live event trackings failed")
@@ -188,16 +185,15 @@ func (vc *VideoCrawler) startLiveCrawler(enterPoint PointF) error {
// take screenshot and get screen texts by OCR
screenResult, err := vc.driverExt.GetScreenResult(
WithScreenShotOCR(true), WithScreenShotUpload(true))
WithScreenShotOCR(true), WithScreenShotUpload(true), WithScreenShotLiveType(true))
if err != nil {
log.Error().Err(err).Msg("OCR GetTexts failed")
time.Sleep(3 * time.Second)
continue
}
liveRoom.LiveType = screenResult.LiveType
screenResult.Live = liveRoom
// TODO: check live type
// incr live count
screenResult.VideoType = "live"
vc.LiveCount++