Skip to content

Commit

Permalink
快手添加result状态错误提示
Browse files Browse the repository at this point in the history
  • Loading branch information
wujunwei928 committed Jun 30, 2024
1 parent 3005935 commit 5590cb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parser/kuaishou.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func (k kuaiShou) parseShareUrl(shareUrl string) (*VideoParseInfo, error) {
return nil, err
}

if resultCode := gjson.GetBytes(videoRes.Body(), "result").Int(); resultCode != 1 {
return nil, fmt.Errorf("获取作品信息失败:result=%d", resultCode)
}

data := gjson.GetBytes(videoRes.Body(), "photo")
avatar := data.Get("headUrl").String()
author := data.Get("userName").String()
Expand Down

0 comments on commit 5590cb2

Please sign in to comment.