1.https://space.bilibili.com/49246269 采集个人主页所有视频
那么我们拿到的接口
https://api.bilibili.com/x/space/wbi/arc/search?pn=1&ps=50&order=pubdate&keyword=&mid=xxx&gaia_source=m_station&platform=h5&web_location=1280305&w_rid=xxx&wts=xxxx
如果无法破解w_rid和wts 那么会提示风控, 怎么破解w_rid 和 wts 直接上代码, 不废话
# coding:utf-8 """ # 逆向破解w_rid 和 wst """ import execjs class UserWridWst: def __init__(self): pass def getWRidAndWts(self, mid: int = 18154819, pn: int = 1): js_code = """ var $e = { wbiImgKey: 'c6618eced9b64a019d0e6247aed7a38e', wbiSubKey: '6bb3adc89c244ccda6d9abf22fc6f910' }; var localStorage = function() {} localStorage.wbi_img_url = 'https://i0.hdslb.com/bfs/wbi/7cd084941338484aae1ad9425b84077c.png'; localStorage.wbi_sub_url = 'https://i0.hdslb.com/bfs/wbi/4932caff0ff746eab6f01bf08b70ac45.png'; localStorage.getItem = function(keys) { return localStorage[keys]; } function createCommonjsModule(pe, $e) { return $e = { exports: {} }, pe($e, $e.exports), $e.exports } var crypt = createCommonjsModule(function(pe) { (function() { var $e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" , Pe = { rotl: function(Me, Fe) { return Me << Fe | Me >>> 32 - Fe }, rotr: function(Me, Fe) { return Me << 32 - Fe | Me >>> Fe }, endian: function(Me) { if (Me.constructor == Number) return Pe.rotl(Me, 8) & 16711935 | Pe.rotl(Me, 24) & 4278255360; for (var Fe = 0; Fe < Me.length; Fe++) Me[Fe] = Pe.endian(Me[Fe]); return Me }, randomBytes: function(Me) { for (var Fe = []; Me > 0; Me--) Fe.push(Math.floor(Math.random() * 256)); return Fe }, bytesToWords: function(Me) { for (var Fe = [], Le = 0, je = 0; Le < Me.length; Le++, je += 8) Fe[je >>> 5] |= Me[Le] << 24 - je % 32; return Fe }, wordsToBytes: function(Me) { for (var Fe = [], Le = 0; Le < Me.length * 32; Le += 8) Fe.push(Me[Le >>> 5] >>> 24 - Le % 32 & 255); return Fe }, bytesToHex: function(Me) { for (var Fe = [], Le = 0; Le < Me.length; Le++) Fe.push((Me[Le] >>> 4).toString(16)), Fe.push((Me[Le] & 15).toString(16)); return Fe.join("") }, hexToBytes: function(Me) { for (var Fe = [], Le = 0; Le < Me.length; Le += 2)