B站人主页w_rid 和 wst 破解

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)
   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值