一、通过抓包,发现buvid3值存在与该链接的响应cookie中
二、Python代码实现
import requests def 获取buvid3(): 视频地址='https://www.bilibili.com/video/BV1vo4y1A7ED/' 头信息={ 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' } 响应=requests.get(url=视频地址,headers=头信息) buvid3=响应.cookies.get_dict() print(buvid3['buvid3']) 获取buvid3()
三、重新清除cookie,刷新页面,全局搜索_uuid的值,并在关键处下断,这里是一个三元运算符,如果空值,就赋值Object(l.a)()
四、进入Object(l.a)()函数
五、将该函数复制到js编辑器,然后再找a函数和s函数,a函数又用到了o函数,正好都在附近,最终js代码加密如下
function getuuid(){ var e = a(8) , t = a(4) , r = a(4) , n = a(4) , o = a(12) , i = (new Date).getTime(); return e + "-" + t + "-" + r + "-" + n + "-" + o + s((i % 1e5).toString(), 5) + "infoc" } function a(e) { for (var t = "", r = 0; r < e; r++) t += o(16 * Math.random()); return s(t, e) } function s(e, t) { var r = ""; if (e.length < t) for (var n = 0; n < t - e.length; n++) r += "0"; return r + e } function o(e) { return Math.ceil(e).toString(16).toUpperCase() }
六、运行结果