先上一段wget的https请求头信息:
GET /upgcxcode/53/83/215348353/215348353-1-16.mp4?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfq9rVEuxTEnE8L5F6VnEsSTx0vkX8fqJeYTj_lta53NCM=&uipk=5&nbs=1&deadline=1595475553&gen=playurl&os=hwbv&oi=1903092525&trid=3b6a48903ab1485da71fb2def726d36ah&platform=html5&upsig=36a78c68e467929467a8734a770aaa5a&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&mid=0&logo=80000000&dlnaopt=2&tpseq=1 HTTP/1.1
User-Agent: Wget/1.20 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: upos-sz-mirrorhw.bilivideo.com
Connection: Keep-Alive
请求的url为:
返回如下值:
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>openresty</center>
</body>
</html>
将User-Agent改为如下值解决问题:
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0