diff --git a/plugin/bilibili/util.go b/plugin/bilibili/util.go index f8c9ce8c..ef1372d5 100644 --- a/plugin/bilibili/util.go +++ b/plugin/bilibili/util.go @@ -19,6 +19,7 @@ func getrealurl(url string) (realurl string, err error) { if err != nil { return } + _ = data.Body.Close() realurl = data.Request.URL.String() return } diff --git a/plugin/guessmusic/main.go b/plugin/guessmusic/main.go index be7e79c9..f2582384 100644 --- a/plugin/guessmusic/main.go +++ b/plugin/guessmusic/main.go @@ -755,6 +755,7 @@ func getListMusic(listID, pathOfMusic string) (musicName string, err error) { err = errors.Errorf("下载音乐失败, ERROR: %s", err) return } + _ = response.Body.Close() if response.StatusCode != 200 { err = errors.Errorf("下载音乐失败, Status Code: %d", response.StatusCode) return diff --git a/plugin/saucenao/searcher.go b/plugin/saucenao/searcher.go index 2decbc55..7cbbf457 100644 --- a/plugin/saucenao/searcher.go +++ b/plugin/saucenao/searcher.go @@ -143,8 +143,13 @@ func init() { // 插件主体 } else { msg = append(msg, message.Text("也许是这个?")) } - if err == nil && resp.StatusCode == http.StatusOK { - msg = append(msg, message.Image(result.Header.Thumbnail)) + if err == nil { + _ = resp.Body.Close() + if resp.StatusCode == http.StatusOK { + msg = append(msg, message.Image(result.Header.Thumbnail)) + } else { + msg = append(msg, message.Image(pic)) + } } else { msg = append(msg, message.Image(pic)) }