乐视网页中视频请求接口中tkey计算——间接调用

October 13, 2018 · 分享 · 6次阅读

http://player-pc.le.com/mms/out/video/playJson.json?platid=1&splatid=107&tss=no&id=1578861&detect=0&dvtype=1000&accessyx=1&domain=m.le.com&tkey=1331462795&devid=82b7ba07f710dc9cfa1614a7c218e596&source=1001&lang=cn&region=cn&isHttps=0

这是乐视在移动端的视频请求接口,其中tkey是主要的参数,缺少就得不到结果。

通过搜索tkey可以发现只在下面这个js出现过
http://jstatic.letvcdn.com/sdk/player.js

            var t, a = r.PROTOCAL + r.HOST_NAME.PLAYER_PC_LETV_COM + "/mms/out/video/playJson.json", i = n.getMmsKey(e);
            if (this.playerData.videoType = !this.playerData.config.supportP2P && "" != o.supportM3U8 && "1" != o.supportM3U8 || o.forceMp4 ? "no" : "ios",
            parent === window)
                try {
                    t = location.host
                } catch (l) {
                    t = "." + document.domain
                }
            var d = {
                1: "350",
                2: "1000",
                3: "1300",
                4: "720p",
                5: "1080p"
            }
              , h = {
                105: 1,
                106: 1,
                107: 1
            }
              , c = {
                platid: h[this.playerData.config.splatId] || 3,
                splatid: this.playerData.config.splatId,
                tss: this.playerData.videoType,
                id: this.playerData.vinfo.vid,
                detect: this.playerData.flashVar.mmDetect || "1",
                dvtype: d[this.playerData.config.defi] || "",
                accessyx: 1,
                domain: t,
                tkey: i,
                devid: this.manager.pingback.getLC(),
                source: "1001",
                lang: this.playerData.flashVar.lan,
                region: this.manager.listener.get(r.REGION),
                isHttps: 1 == this.playerData.flashVar.isHttps ? 1 : 0
            };

可以得知tkey是函数getMmsKey计算的,通过断点得到计算代码(VM中计算的)
代码如下

var Y6K = (function () {
    var M9 = (57.9E1, 92.194E3) < 31.593E+2 ? (97.9E2, 0x50) : 40. <= (23., 0x43) ? (33E1, 0x1e0f19174415) : (99.551E2, 0.) < (0x26, 60) ? (0x56, 85.669E2) : (86, 35.95E0) > 55. ? 0x33 : 0x60,
    I9 = (function (j3, p7) {
        var V4 = "",
        R7 = 92 >= (59.172E2, 45.114E2) ? 0x6 : (0x22, 83) <= (0x53, 52.) ? (71, 81.124E3) : (4, 20.443E2) <= (0x23, 0x2c) ? 91 : (86.075E+0, 0x4f) < (2.8E3, 85) ? (0x4, false) : (30, 0x13) < (0.19E2, 21.01E1) ? (0x11, 46E1) : (87., 58.1E1);
        if (j3.length > 97. > 5.012E2 ? (0x3b, 0x1f) : (80.604E0, 52.52E2) > (0x13, 50.585E2) ? (0x3b, 0xc) : (0x4a, 0x37) < (0x33, 73.36E+0) ? (0x51, 20.8E+1) : (3, 0x3) <= (53.31E1, 18.266E+0) ? 9. : (37.2E2, 75.5E1))
            for (var G5 = 13.935E2 >= (41., 93.8E0) ? (0x49, 0xd) : (0x34, 0x21) < 0x42 ? (62, 12.09E+3) : 85. >= (0x2f, 0x1d) ? (0x58, 30.6E2) : (27.1E0, 48.) < (0x37, 87.62E3) ? (62.524E1, 0xa) : 97 <= (0x5f, 0xf) ? 49.1E1 : 5.05E2 >= (23.1E3, 80.312E+1) ? (0x36, 0x56) : (3., 0x51) < 13.9E1 ? 70.52E+2 : 72.663E3; G5 > 1; )
                V4 += (R7 = R7 ? 52. < (90.8E3, 0xa) ? (0x2c, 66) : (63.3E2, 0x55) < (0x5b, 0x0) ? (1.989E2, 15.9E1) : (28.85E1, 0x2d) >= 93.1E3 ? (26.7E0, 95.8E1) : (65.14E3, 0x34) >= (0xc, 57.8E1) ? (98.3E0, 74.8E+2) : (0x52, 0x54) > (12.35E3, 52.2E3) ? 0x49 : (37.364E2, 85.2E3) <= (36, 0x38) ? 39.7E1 : (26.176E2, 0x63) > 0x3a ? (71.858E1, false) : (2.832E2, 53E+3) : (0x27, 19.63E1) <= (0x49, 77.) ? (69.55E2, 39.85E+2) : (0x22, 0x63) <= 0x3d ? (0x38, 47.06E1) : (91., 92.87E2) <= (76.2E2, 0x50) ? (68.411E+2, 0x54) : (61.96E1, 0x3a) >= (0x9, 9.6E1) ? (0x1, 0x22) : (67.347E1, 22.699E1) < 76.574E2 ? (0xa, true) : (29., 86) >= (14, 0x1d) ? (0x52, 2.2E+0) : 0x1e) ? j3.charAt(G5) : "@%)eitg)(tDwn".charAt(G5--);
        return p7 === null ? eval(V4) : p7 ^ j3
    })("_9(mTe.)ea e(", 0x3d >= 19.2E2 ? (79, 37.1E1) : 85E3 <= 0x47 ? (33.7E1, 77) : (0x8, 14.) >= (85.778E2, 61.) ? 7 : 0x5a < (86.37E1, 3.218E2) ? null : (0xd, 0x58) >= (64., 0xc) ? (72.1E3, 16) : (1, 0x2f) > 0x54 ? (7.5E0, 0x5b) : (38.4E+2, 56.2E2));
    return {
        k0: function (S7) {
            var C7,
            R2 = (88.4E3, 90.058E3) <= (36E1, 0x1d) ? (85., 0x1) : (0x4d, 84) >= 73.041E1 ? 91 : (0xe, 0x16) >= (20., 0x5b) ? (34., 0x3e) : 10 < 0x1c ? (25.801E0, 0x0) : 92.374E3 < (56.2E+2, 20.) ? (85.08E3, 0x42) : (0x14, 24.5E2) >= (0x1a, 0x5d) ? (75, 0x44) : (0x3f, 0x2d) < (51.9E1, 0x7) ? (4, 0x1f) : (45.654E1, 0.046E+1),
            Y9 = M9 > I9,
            U2;
            for (; R2 < S7.length; ) {
                U2 = (parseInt(S7.charAt(R2), (0x2f, 0x61) >= (0x58, 61.49E2) ? (0x2b, 14.6E+0) : 80.6E1 > 1. ? (95., 0x10) : 0x59 >= 57.386E+1 ? (48., 77.) : 31.23E1 <= (94.3E2, 32.) ? (86., 60) : (7.819E+1, 0x54) < (3.9E3, 86.) ? 48.649E0 : 84. < (22, 16.6E+3) ? (0x44, 0x54) : (55, 82.9E1) <= (64.12E2, 0x57) ? (0x3a, 0xe) : (70.003E+0, 0x35))).toString(0x1f >= (67., 0x30) ? (0x62, 57.5E+1) : (61.499E1, 41.52E3) < (81.763E1, 48) ? (0x7, 68.73E2) : (12, 91.3E+2) >= (0x4b, 0xf) ? (96, 0x2) : (86., 82.84E+1) >= 0x3f ? (0x11, 35.138E1) : (0x15, 0x61) < (0x10, 0x8) ? (0x5f, 19.) : (13E+2, 0x35) > 94.2E+0 ? (0x2, 0xb) : (71.008E1, 89.65E2));
                C7 = R2++ == 0x1c >= (85., 55) ? (0xb, 0.65E0) : (0x1a, 0x26) >= (0x55, 89.657E3) ? (0x1d, 0x2) : (53.34E2, 56.9E+1) < 90. ? 6.254E1 : 12.4E2 <= (70., 63.84E3) ? 0x0 : 0x2f >= (0, 36.83E1) ? (0x61, 0x29) : (27., 67.792E3) > (67.19E1, 0x55) ? 36.979E0 : (0x2d, 28.3E1) ? U2.charAt(U2.length - (0x2e, 0x36) < (14, 0xd) ? (0x29, 7.2E+0) : (0x14, 77.) < 58. ? 16.569E2 : (0x31, 60.64E+1) > (90., 61.4E+1) ? (0x1, 81E0) : (79.43E0, 0x49) <= (20., 26.) ? (30.65E2, 55.) : (0x13, 0x1)) : C7 ^ U2.charAt(U2.length - (0.4E0, 0x22) >= 43.8E0 ? (0x38, 56.34E2) : (98, 0x16) < (0x39, 11.) ? (0x21, 13) : (0x51, 0x34) <= 97.9E2 ? (0x35, 0x1) : (28, 69.) < (0x40, 94.802E+0) ? (64.6E2, 39) : (15., 30))
            }
            return C7 ? !Y9 : Y9
        }
    }
})();
var _1 = "feda8dd6e0127da88f3487a646fe8a6b", _2 = Y6K.k0("08") ? "jjuy9567dfj6bkksomnnghwokjlu0o" : "b", _3 = Y6K.k0("68") ? "tYt2bxik" : "toString";
var I4c = {
    I: function (l, v) {
        return l != v
    },
    f: function (l, v) {
        return l << v
    },
    b: function (l, v) {
        return l & v
    },
    B: function (l, v) {
        return l < v
    },
    A: function (l, v) {
        return l !== v
    },
    G: function (l, v) {
        return l ^ v
    },
    v: function (l, v) {
        return l === v
    },
    N: function (l, v) {
        return l - v
    },
    k: function (l, v) {
        return l >> v
    },
    m: function (l, v) {
        return l | v
    },
    Y: function (l, v) {
        return l == v
    },
    j: function (l, v) {
        return l % v
    },
    h: function (l, v) {
        return l > v
    }
};
var Key = {
    liveKey: {
        "default": _1
    },
    APIKey: _2,
    secret_key: _3,
    getAPIKey: function (e) {
        var _1 = Y6K.k0("u29") ? "AES" : "rotateRight",
        _2 = "decrypt",
        _3 = Y6K.k0("63") ? "APIKey" : "decrypt",
        _4 = "toString",
        _5 = "enc",
        _6 = "Utf8",
        _7 = Y6K.k0("h93") ? "error" : "MD5";
        try {
            return Encode[_1][_2](e, this[_3])[_4](Encode[_5][_6])
        } catch (t) {
            return _7
        }
    },
    getCl: function (e) {
        var _1 = Y6K.k0("4f") ? "MD5" : "decrypt",
        _2 = Y6K.k0("471") ? "showmethemoney" : "join",
        _3 = "error";
        try {
            return Encode[_1](e + _2)
        } catch (t) {
            return _3
        }
    },
    getMmsKey: function (e) {
        var _1 = Y6K.k0("1436") ? "j" : "error",
        _2 = "rotateRight",
        _3 = "G";
        var t = ("j", 48.36E2) < 68. ? ("error", 0x61) : (85.5E2, 0x11) < 84. ? (25.045E1, 0xb074319) : 39.62E1 <= (",", 25.2E+1) ? 88. : 32.84E2 >= (81.5E2, 36.7E0) ? 0x27 : 0x55 > 0x37 ? (79.219E0, 0x1c) : ("G", 0.363E1) <= 44.834E2 ? 98 : 95.48E+3 > (0x0, 0x45) ? (1.288E3, "h") : ("b", 0x1b) >= (95.38E+0, 0x5e) ? (37.9E+0, 0x1a) : (19.1E+0, 71.6E2) > (0x30, "error") ? (0x5e, 6.62E1) : (58.58E1, 57.5E+1),
        r = I4c[_1](t, 17),
        n = e;
        n = this[_2](n, r);
        var o = I4c[_3](n, t);
        return o
    },
    rotateRight: function (e, t) {
        var _1 = Y6K.k0("572U") ? "h" : "error",
        _2 = Y6K.k0("6U8a") ? "b" : "toString";
        for (var r, n = 0; I4c[_1](t, n); n++)
            r = I4c[_2](1, e), e >>= 1, r <<= 31, e += r;
        return e
    },
    getLiveTkey: function (e, t, r) {
        var _1 = "liveKey",
        _2 = "default",
        _3 = Y6K.k0("9755") ? "MD5" : "b",
        _4 = Y6K.k0("09") ? "join" : "jjuy9567dfj6bkksomnnghwokjlu0o",
        _5 = ",",
        _6 = Y6K.k0("my") ? "toString" : "AES";
        var r = r || this[_1][_2];
        return Encode[_3]([e, t, r][_4](_5))[_6]()
    },
    getPingBackKey: function (e, t, r, n) {
        var _1 = "MD5",
        _2 = "secret_key",
        _3 = "toString";
        return Encode[_1](e + t + r + n + this[_2])[_3]()
    }
};

在末尾添加
console.log(Key.getMmsKey('1539412506.487'));
保存为然后将代码保存为js文件,通过node xxx.js运行可以得到tkey是多少
id=1578861对应于网页链接中的数字

标签:none

最后编辑于:2018/10/31 12:43

添加新评论