👍 添加查成分功能,修改bilibili插件的正则 (#171)

* :sparkles:添加查成分功能

* :rotating_light:修lint

* :rotating_light:减少空格

* :bug:修改网址

* :bug:修改vup数量错误问题

* :bug:图片读取不了,就不读了

* 🐛 固定头像大小,bilibilipush调公有库

* 🎨 修改json转换

Co-authored-by: Guohuiyuan <haibaraguo@yeahka.com>
This commit is contained in:
himawari
2022-03-29 13:03:46 +08:00
committed by GitHub
parent 7be1a61347
commit 006ef6f672
6 changed files with 577 additions and 140 deletions

View File

@@ -5,8 +5,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"strconv"
"time"
@@ -300,20 +298,7 @@ func getLiveList(uids ...int64) string {
m := make(map[string]interface{})
m["uids"] = uids
b, _ := json.Marshal(m)
client := &http.Client{}
// 提交请求
request, err := http.NewRequest("POST", liveListURL, bytes.NewBuffer(b))
if err != nil {
log.Errorln("[bilibilipush]:", err)
}
request.Header.Add("Referer", referer)
request.Header.Add("User-Agent", ua)
response, err := client.Do(request)
if err != nil {
log.Errorln("[bilibilipush]:", err)
}
defer response.Body.Close()
data, err := io.ReadAll(response.Body)
data, err := web.PostData(liveListURL, "application/json", bytes.NewReader(b))
if err != nil {
log.Errorln("[bilibilipush]:", err)
}