update user-agent

This commit is contained in:
aynakeya
2024-05-10 10:21:18 +08:00
parent 4e77cdfd0e
commit b36d0b6189

View File

@@ -26,10 +26,10 @@ type BilibiliVideo struct {
func NewBilibiliViedo() *BilibiliVideo {
headers := map[string]string{
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"Referer": "https://www.bilibili.com/",
"Origin": "https://www.bilibili.com",
"Cookie": "buvid3=9A8B3564-BDA9-407F-B45F-D5C40786CA49167618infoc;",
"Cookie": "buvid3=40BA0253-7F5C-06C1-12CE-871EC008DB2096426infoc;",
}
pvdr := &BilibiliVideo{
BVRegex: regexp.MustCompile("^BV[0-9A-Za-z]+"),
@@ -84,6 +84,7 @@ func NewBilibiliViedo() *BilibiliVideo {
},
deepcolor.ParserGJson,
func(resp *gjson.Result, result *[]miaosic.MediaInfo) error {
fmt.Println(resp.String())
if resp.Get("code").String() != "0" {
return errors.New("failed to find required data")
}