mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 15:20:22 +00:00
🐛 搜图 有时无法下载图片
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user