完整视频视频

https://www.bilibili.com/video/BV1qg411S7aX/

网站地址

https://www.pdskgb.com

pdskgb.js代码

function randomWord(t, e, n) {
    var r = ""
        , i = e
        , o = ""
        , a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
    t && (i = Math.round(Math.random() * (n - e)) + e);
    for (var s = 0; s < i; s++)
        o = Math.round(Math.random() * (a.length - 1)),
            r += a[o];
    return r
}

function dateFormat(t, e, n) {
    Date.prototype.Format = function(t, e) {
        var n = {
            "M+": (e ? this.getUTCMonth() : this.getMonth()) + 1,
            "d+": e ? this.getUTCDate() : this.getDate(),
            "h+": e ? this.getUTCHours() : this.getHours(),
            "m+": e ? this.getUTCMinutes() : this.getMinutes(),
            "s+": e ? this.getUTCSeconds() : this.getSeconds(),
            "q+": Math.floor(((e ? this.getUTCMonth() : this.getMonth()) + 3) / 3),
            S: e ? this.getUTCMilliseconds() : this.getMilliseconds()
        };
        /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((e ? this.getUTCFullYear() : this.getFullYear()) + "").substr(4 - RegExp.$1.length)));
        for (var r in n)
            new RegExp("(" + r + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? n[r] : ("00" + n[r]).substr(("" + n[r]).length)));
        return t
    }
    ;
    try {
        return t.Format(e, n)
    } catch (t) {
        return console.log(t.stack),
            null
    }
}

function md5(t) {
    function e(t, e) {
        return t << e | t >>> 32 - e
    }
    function n(t, e) {
        var n, r, i, o, a;
        return i = 2147483648 & t,
            o = 2147483648 & e,
            n = 1073741824 & t,
            r = 1073741824 & e,
            a = (1073741823 & t) + (1073741823 & e),
            n & r ? 2147483648 ^ a ^ i ^ o : n | r ? 1073741824 & a ? 3221225472 ^ a ^ i ^ o : 1073741824 ^ a ^ i ^ o : a ^ i ^ o
    }
    function r(t, e, n) {
        return t & e | ~t & n
    }
    function i(t, e, n) {
        return t & n | e & ~n
    }
    function o(t, e, n) {
        return t ^ e ^ n
    }
    function a(t, e, n) {
        return e ^ (t | ~n)
    }
    function s(t, i, o, a, s, c, u) {
        return t = n(t, n(n(r(i, o, a), s), u)),
            n(e(t, c), i)
    }
    function c(t, r, o, a, s, c, u) {
        return t = n(t, n(n(i(r, o, a), s), u)),
            n(e(t, c), r)
    }
    function u(t, r, i, a, s, c, u) {
        return t = n(t, n(n(o(r, i, a), s), u)),
            n(e(t, c), r)
    }
    function l(t, r, i, o, s, c, u) {
        return t = n(t, n(n(a(r, i, o), s), u)),
            n(e(t, c), r)
    }
    function f(t) {
        var e, n, r = "", i = "";
        for (n = 0; n <= 3; n++)
            e = t >>> 8 * n & 255,
                i = "0" + e.toString(16),
                r += i.substr(i.length - 2, 2);
        return r
    }
    var p, d, h, m, g, v, y, b, w, _ = Array();
    for (t = function(t) {
        t = t.replace(/\r\n/g, "\n");
        for (var e = "", n = 0; n < t.length; n++) {
            var r = t.charCodeAt(n);
            r < 128 ? e += String.fromCharCode(r) : r > 127 && r < 2048 ? (e += String.fromCharCode(r >> 6 | 192),
                e += String.fromCharCode(63 & r | 128)) : (e += String.fromCharCode(r >> 12 | 224),
                e += String.fromCharCode(r >> 6 & 63 | 128),
                e += String.fromCharCode(63 & r | 128))
        }
        return e
    }(t),
             _ = function(t) {
                 for (var e, n = t.length, r = n + 8, i = (r - r % 64) / 64, o = 16 * (i + 1), a = Array(o - 1), s = 0, c = 0; c < n; )
                     e = (c - c % 4) / 4,
                         s = c % 4 * 8,
                         a[e] = a[e] | t.charCodeAt(c) << s,
                         c++;
                 return e = (c - c % 4) / 4,
                     s = c % 4 * 8,
                     a[e] = a[e] | 128 << s,
                     a[o - 2] = n << 3,
                     a[o - 1] = n >>> 29,
                     a
             }(t),
             v = 1732584193,
             y = 4023233417,
             b = 2562383102,
             w = 271733878,
             p = 0; p < _.length; p += 16)
        d = v,
            h = y,
            m = b,
            g = w,
            v = s(v, y, b, w, _[p + 0], 7, 3614090360),
            w = s(w, v, y, b, _[p + 1], 12, 3905402710),
            b = s(b, w, v, y, _[p + 2], 17, 606105819),
            y = s(y, b, w, v, _[p + 3], 22, 3250441966),
            v = s(v, y, b, w, _[p + 4], 7, 4118548399),
            w = s(w, v, y, b, _[p + 5], 12, 1200080426),
            b = s(b, w, v, y, _[p + 6], 17, 2821735955),
            y = s(y, b, w, v, _[p + 7], 22, 4249261313),
            v = s(v, y, b, w, _[p + 8], 7, 1770035416),
            w = s(w, v, y, b, _[p + 9], 12, 2336552879),
            b = s(b, w, v, y, _[p + 10], 17, 4294925233),
            y = s(y, b, w, v, _[p + 11], 22, 2304563134),
            v = s(v, y, b, w, _[p + 12], 7, 1804603682),
            w = s(w, v, y, b, _[p + 13], 12, 4254626195),
            b = s(b, w, v, y, _[p + 14], 17, 2792965006),
            y = s(y, b, w, v, _[p + 15], 22, 1236535329),
            v = c(v, y, b, w, _[p + 1], 5, 4129170786),
            w = c(w, v, y, b, _[p + 6], 9, 3225465664),
            b = c(b, w, v, y, _[p + 11], 14, 643717713),
            y = c(y, b, w, v, _[p + 0], 20, 3921069994),
            v = c(v, y, b, w, _[p + 5], 5, 3593408605),
            w = c(w, v, y, b, _[p + 10], 9, 38016083),
            b = c(b, w, v, y, _[p + 15], 14, 3634488961),
            y = c(y, b, w, v, _[p + 4], 20, 3889429448),
            v = c(v, y, b, w, _[p + 9], 5, 568446438),
            w = c(w, v, y, b, _[p + 14], 9, 3275163606),
            b = c(b, w, v, y, _[p + 3], 14, 4107603335),
            y = c(y, b, w, v, _[p + 8], 20, 1163531501),
            v = c(v, y, b, w, _[p + 13], 5, 2850285829),
            w = c(w, v, y, b, _[p + 2], 9, 4243563512),
            b = c(b, w, v, y, _[p + 7], 14, 1735328473),
            y = c(y, b, w, v, _[p + 12], 20, 2368359562),
            v = u(v, y, b, w, _[p + 5], 4, 4294588738),
            w = u(w, v, y, b, _[p + 8], 11, 2272392833),
            b = u(b, w, v, y, _[p + 11], 16, 1839030562),
            y = u(y, b, w, v, _[p + 14], 23, 4259657740),
            v = u(v, y, b, w, _[p + 1], 4, 2763975236),
            w = u(w, v, y, b, _[p + 4], 11, 1272893353),
            b = u(b, w, v, y, _[p + 7], 16, 4139469664),
            y = u(y, b, w, v, _[p + 10], 23, 3200236656),
            v = u(v, y, b, w, _[p + 13], 4, 681279174),
            w = u(w, v, y, b, _[p + 0], 11, 3936430074),
            b = u(b, w, v, y, _[p + 3], 16, 3572445317),
            y = u(y, b, w, v, _[p + 6], 23, 76029189),
            v = u(v, y, b, w, _[p + 9], 4, 3654602809),
            w = u(w, v, y, b, _[p + 12], 11, 3873151461),
            b = u(b, w, v, y, _[p + 15], 16, 530742520),
            y = u(y, b, w, v, _[p + 2], 23, 3299628645),
            v = l(v, y, b, w, _[p + 0], 6, 4096336452),
            w = l(w, v, y, b, _[p + 7], 10, 1126891415),
            b = l(b, w, v, y, _[p + 14], 15, 2878612391),
            y = l(y, b, w, v, _[p + 5], 21, 4237533241),
            v = l(v, y, b, w, _[p + 12], 6, 1700485571),
            w = l(w, v, y, b, _[p + 3], 10, 2399980690),
            b = l(b, w, v, y, _[p + 10], 15, 4293915773),
            y = l(y, b, w, v, _[p + 1], 21, 2240044497),
            v = l(v, y, b, w, _[p + 8], 6, 1873313359),
            w = l(w, v, y, b, _[p + 15], 10, 4264355552),
            b = l(b, w, v, y, _[p + 6], 15, 2734768916),
            y = l(y, b, w, v, _[p + 13], 21, 1309151649),
            v = l(v, y, b, w, _[p + 4], 6, 4149444226),
            w = l(w, v, y, b, _[p + 11], 10, 3174756917),
            b = l(b, w, v, y, _[p + 2], 15, 718787259),
            y = l(y, b, w, v, _[p + 9], 21, 3951481745),
            v = n(v, d),
            y = n(y, h),
            b = n(b, m),
            w = n(w, g);
    return (f(v) + f(y) + f(b) + f(w)).toLowerCase()
}

function encodeUTF8(t) {
    var e, n, r, i = [];
    for (e = 0; e < t.length; e++)
        (n = t.charCodeAt(e)) < 128 ? i.push(n) : n < 2048 ? i.push(192 + (n >> 6 & 31), 128 + (63 & n)) : ((r = 55296 ^ n) >> 10 == 0 ? (n = (r << 10) + (56320 ^ t.charCodeAt(++e)) + 65536,
            i.push(240 + (n >> 18 & 7), 128 + (n >> 12 & 63))) : i.push(224 + (n >> 12 & 15)),
            i.push(128 + (n >> 6 & 63), 128 + (63 & n)));
    return i
}

function sha1(t) {
    var e, n, r, o = new Uint8Array(encodeUTF8(t)), a = 16 + (o.length + 8 >>> 6 << 4), t = new Uint8Array(a << 2);
    for (t.set(new Uint8Array(o.buffer)),
             t = new Uint32Array(t.buffer),
             r = new DataView(t.buffer),
             e = 0; e < a; e++)
        t[e] = r.getUint32(e << 2);
    t[o.length >> 2] |= 128 << 24 - 8 * (3 & o.length),
        t[a - 1] = o.length << 3;
    var s = []
        , c = [function() {
        return f[1] & f[2] | ~f[1] & f[3]
    }
        , function() {
            return f[1] ^ f[2] ^ f[3]
        }
        , function() {
            return f[1] & f[2] | f[1] & f[3] | f[2] & f[3]
        }
        , function() {
            return f[1] ^ f[2] ^ f[3]
        }
    ]
        , u = function(t, e) {
        return t << e | t >>> 32 - e
    }
        , l = [1518500249, 1859775393, -1894007588, -899497514]
        , f = [1732584193, -271733879, null, null, -1009589776];
    for (f[2] = ~f[0],
             f[3] = ~f[1],
             e = 0; e < t.length; e += 16) {
        var p = f.slice(0);
        for (n = 0; n < 80; n++)
            s[n] = n < 16 ? t[e + n] : u(s[n - 3] ^ s[n - 8] ^ s[n - 14] ^ s[n - 16], 1),
                r = u(f[0], 5) + c[n / 20 | 0]() + f[4] + s[n] + l[n / 20 | 0] | 0,
                f[1] = u(f[1], 30),
                f.pop(),
                f.unshift(r);
        for (n = 0; n < 5; n++)
            f[n] = f[n] + p[n] | 0
    }
    r = new DataView(new Uint32Array(f).buffer);
    for (var e = 0; e < 5; e++)
        f[e] = r.getUint32(e << 2);
    return Array.prototype.map.call(new Uint8Array(new Uint32Array(f).buffer), function(t) {
        return (t < 16 ? "0" : "") + t.toString(16)
    }).join("")
}

function getSecretParam(id) {
    var t='pdsmk'
    var n = md5(md5(t))
        , r = randomWord(!1, 36)
        , o = dateFormat(new Date, "yyyy-MM-ddThh:mm:ssZ", !0);
    var srcKey=n + r + o + '1.0';
    var a;
    if(id){
        a=id;
    }else{
        a=md5((new Date).getTime() + "deviceID");
    }
    return {srcKey:srcKey,deviceID:a,tenant:n,nonce:r,timestamp:o}
}

python代码

# -*- coding: utf-8 -*-
# @Author: Null119 微信公众号/网站:治廷君
# @Desc: { 中国平媒神马报 }
# @Date: { 2022/9/7 }

import requests,execjs,json,urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

ctx = execjs.compile(open('./pdskgb.js').read())

r=requests.Session()

enstr = f'getSecretParam("")'
rdata = str(ctx.eval(enstr)).replace("'",'"')
print(rdata)
rjson=json.loads(rdata)
srcKey=rjson['srcKey']
deviceID=rjson['deviceID']
nonce=rjson['nonce']
tenant=rjson['tenant']
timestamp=rjson['timestamp']


enstr = f'sha1("'+srcKey+deviceID+'2")'
sign = str(ctx.eval(enstr))
print('sign:',sign)

headers={
    'Accept':'application/json, text/plain, */*',
    'Content-Type':'application/json;charset=UTF-8',
    'nonce':nonce,
    'tenant':tenant,
    'timestamp':timestamp,
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.27',
    'version':'1.0'
}

pdat='{"sid":"pdsmk","deviceID":"'+deviceID+'","source":2,"sign":"'+sign+'"}'

resp=r.post('https://www.pdskgb.com/api/getAppToken',data=pdat,headers=headers,verify=False)
authtoken=resp.json()['authtoken']
print('authtoken:',authtoken)

enstr = f'getSecretParam("{deviceID}")'
rdata = str(ctx.eval(enstr)).replace("'",'"')
print(rdata)
rjson=json.loads(rdata)
srcKey=rjson['srcKey']
deviceID=rjson['deviceID']
nonce=rjson['nonce']
tenant=rjson['tenant']
timestamp=rjson['timestamp']

headers={
    "Accept":"application/json, text/plain, */*",
    "authtoken":authtoken,
    "nonce":nonce,
    "Referer":"https://www.pdskgb.com/newsepaper/10316_116579_1451174_pdsmk.html",
    "tenant":tenant,
    "timestamp":timestamp,
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.27",
    "version":"1.0"
}

cid='10316'
date='2022-08-02'

enstr= srcKey+ cid+deviceID+'2'+ authtoken
enstr = f'sha1("'+enstr+'")'
sign = str(ctx.eval(enstr))
print('sign:',sign)

nurl=f'https://www.pdskgb.com/api/getLayoutsDy?deviceID={deviceID}&source=2&sign={sign}&sid=pdsmk&cid={cid}&date={date}&version=1'
resp=r.get(nurl,headers=headers,verify=False)
print(resp.text)

本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习使用,请在下载后24小时内删除,严禁商用。若由于商用引起版权纠纷,一切责任均由使用者承担。 【注意:本站发布资源来源于网络搜集,均有较强时效性,请在下载前注意查看文章资源发布或更新时间,距离当前时间太久的资源不建议下载,特别是安卓专区相关资源,会有大概率失效无法使用】