🐛 搜图 有时无法下载图片

This commit is contained in:
源文雨
2022-03-13 13:14:01 +08:00
parent 95e8bf2f55
commit b3b50e1353
14 changed files with 26 additions and 25 deletions

View File

@@ -203,12 +203,12 @@ func getLevel(count int) int {
func initPic(picFile string) {
if file.IsNotExist(picFile) {
data, err := web.GetDataWith(web.NewDefaultClient(), backgroundURL, "GET", referer, ua)
data, err := web.RequestDataWith(web.NewDefaultClient(), backgroundURL, "GET", referer, ua)
if err != nil {
log.Errorln("[score]", err)
}
picURL := gjson.Get(string(data), "pic").String()
data, err = web.GetDataWith(web.NewDefaultClient(), picURL, "GET", "", ua)
data, err = web.RequestDataWith(web.NewDefaultClient(), picURL, "GET", "", ua)
if err != nil {
log.Errorln("[score]", err)
}