From b1bdd92a40d18d3bd67cec60701d97b3beed29ba Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Sat, 19 Aug 2023 12:16:03 +0800 Subject: [PATCH] fix: unmarshal feed video --- hrp/pkg/uixt/video_crawler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hrp/pkg/uixt/video_crawler.go b/hrp/pkg/uixt/video_crawler.go index 4c7f314f..b8306164 100644 --- a/hrp/pkg/uixt/video_crawler.go +++ b/hrp/pkg/uixt/video_crawler.go @@ -466,7 +466,8 @@ func getFeedVideo(plugin funplugin.IPlugin, authorName string) (feedVideo *FeedV return nil, errors.New("json marshal feed video info failed") } - err = json.Unmarshal(feedBytes, &feedVideo) + feedVideo = &FeedVideo{} + err = json.Unmarshal(feedBytes, feedVideo) if err != nil { return nil, errors.Wrap(err, "json unmarshal feed video info failed") } @@ -485,9 +486,11 @@ func removeNonAlphanumeric(input string) string { type FeedVideo struct { // 视频基础数据 + CacheKey string `json:"cache_key"` // 视频 CacheKey UserName string `json:"user_name"` // 视频作者 Duration int64 `json:"duration"` // 视频时长(ms) Caption string `json:"caption"` // 视频文案 + Type string `json:"type"` // 视频类型, feed/live // 视频热度数据 ViewCount int64 `json:"view_count"` // feed 观看数