value: function(t) {
var e = (0,
p.default)()
, i = 0;
this.url = this._url,
"refresh" === t ? (i = this.list.length > 0 ? this.list[0].behot_time : 0,
this.url += "min_behot_time=" + i) : (i = this.list.length > 0 ? this.list[this.list.length - 1].behot_time : 0,
this.url += "max_behot_time=" + i);
var n = (0,
v.sign)(i + "");
(0,
a.default)(this.params, {
as: e.as,
cp: e.cp,
_signature: n
})
}
調試后發現
这个找的比较简单
function s() {
var t = Math.floor((new Date).getTime() / 1e3)
, e = t.toString(16).toUpperCase()
, i = (0,
o.default)(t).toString().toUpperCase();
if (8 != e.length)
return {
as: "479BB4B7254C150",
cp: "7E0AC8874BB0985"
};
for (var n = i.slice(0, 5), s = i.slice(-5), a = "", r = 0; r < 5; r++)
a += n[r] + e[r];
for (var l = "", u = 0; u < 5; u++)
l += e[u + 3] + s[u];
return {
as: "A1" + a + e.slice(-3),
cp: e.slice(0, 3) + l + "E1"
}
}
上一段代码放到到node环境下执行,缺什么就往里面加.然后获得完整的代码:
js代码:
function s() {
var t = Math.floor((new Date).getTime() / 1e3)
, e = t.toString(16).toUpperCase()
, i = (0,o)(t).toString().toUpperCase();
if (8 != e.length)
return {
as: "479BB4B7254C150",
cp: "7E0AC8874BB0985"
};
for (var n = i.slice(0, 5), s = i.slice(-5), a = "", r = 0; r < 5; r++)
a += n[r] + e[r];
for (var l = "", u = 0; u < 5; u++)
l += e[u + 3] + s[u];
return {
as: "A1" + a + e.slice(-3),
cp: e.slice(0, 3) + l + "E1",
}
}
function o(t, e, i) {
return e ? i ? b(e, t) : C(e, t) : i ? w(t) : y(t)
}
function y(t) {
return v(w(t))
}
function v(t) {
var e, i, n = "0123456789abcdef", s = "";
for (i = 0; i < t.length; i += 1)
e = t.charCodeAt(i),
s += n.charAt(e >>> 4 & 15) + n.charAt(15 & e);
return s
}
function w(t) {
return _(g(t))
}
function g(t) {
return unescape(encodeURIComponent(t))
}
function _(t) {
function a(t, e) {
var i = (65535 & t) + (65535 & e)
, n = (t >> 16) + (e >> 16) + (i >> 16);
return n << 16 | 65535 & i
}
function o(t, e) {
return t << e | t >>> 32 - e
}
function r(t, e, i, n, s, r) {
return a(o(a(a(e, t), a(n, r)), s), i)
}
function l(t, e, i, n, s, a, o) {
return r(e & i | ~e & n, t, e, s, a, o)
}
function u(t, e, i, n, s, a, o) {
return r(e & n | i & ~n, t, e, s, a, o)
}
function c(t, e, i, n, s, a, o) {
return r(e ^ i ^ n, t, e, s, a, o)
}
function d(t, e, i, n, s, a, o) {
return r(i ^ (e | ~n), t, e, s, a, o)
}
function f(t, e) {
function l(t, e, i, n, s, a, o) {
function r(t, e, i, n, s, r) {
function a(t, e) {
var i = (65535 & t) + (65535 & e)
, n = (t >> 16) + (e >> 16) + (i >> 16);
return n << 16 | 65535 & i
}
function o(t, e) {
return t << e | t >>> 32 - e
}
return a(o(a(a(e, t), a(n, r)), s), i)
}
return r(e & i | ~e & n, t, e, s, a, o)
}
function u(t, e, i, n, s, a, o) {
function r(t, e, i, n, s, r) {
function a(t, e) {
var i = (65535 & t) + (65535 & e)
, n = (t >> 16) + (e >> 16) + (i >> 16);
return n << 16 | 65535 & i
}
function o(t, e) {
return t << e | t >>> 32 - e
}
return a(o(a(a(e, t), a(n, r)), s), i)
}
return r(e & n | i & ~n, t, e, s, a, o)
}
function c(t, e, i, n, s, a, o) {
function r(t, e, i, n, s, r) {
function a(t, e) {
var i = (65535 & t) + (65535 & e)
, n = (t >> 16) + (e >> 16) + (i >> 16);
return n << 16 | 65535 & i
}
function o(t, e) {
return t << e | t >>> 32 - e
}
return a(o(a(a(e, t), a(n, r)), s), i)
}
return r(e ^ i ^ n, t, e, s, a, o)
}
t[e >> 5] |= 128 << e % 32,
t[(e + 64 >>> 9 << 4) + 14] = e;
var i, n, s, o, r, f = 1732584193, h = -271733879, p = -1732584194, _ = 271733878;
for (i = 0; i < t.length; i += 16)
n = f,
s = h,
o = p,
r = _,
f = l(f, h, p, _, t[i], 7, -680876936),
_ = l(_, f, h, p, t[i + 1], 12, -389564586),
p = l(p, _, f, h, t[i + 2], 17, 606105819),
h = l(h, p, _, f, t[i + 3], 22, -1044525330),
f = l(f, h, p, _, t[i + 4], 7, -176418897),
_ = l(_, f, h, p, t[i + 5], 12, 1200080426),
p = l(p, _, f, h, t[i + 6], 17, -1473231341),
h = l(h, p, _, f, t[i + 7], 22, -45705983),
f = l(f, h, p, _, t[i + 8], 7, 1770035416),
_ = l(_, f, h, p, t[i + 9], 12, -1958414417),
p = l(p, _, f, h, t[i + 10], 17, -42063),
h = l(h, p, _, f, t[i + 11], 22, -1990404162),
f = l(f, h, p, _, t[i + 12], 7, 1804603682),
_ = l(_, f, h, p, t[i + 13], 12, -40341101),
p = l(p, _, f, h, t[i + 14], 17, -1502002290),
h = l(h, p, _, f, t[i + 15], 22, 1236535329),
f = u(f, h, p, _, t[i + 1], 5, -165796510),
_ = u(_, f, h, p, t[i + 6], 9, -1069501632),
p = u(p, _, f, h, t[i + 11], 14, 643717713),
h = u(h, p, _, f, t[i], 20, -373897302),
f = u(f, h, p, _, t[i + 5], 5, -701558691),
_ = u(_, f, h, p, t[i + 10], 9, 38016083),
p = u(p, _, f, h, t[i + 15], 14, -660478335),
h = u(h, p, _, f, t[i + 4], 20, -405537848),
f = u(f, h, p, _, t[i + 9], 5, 568446438),
_ = u(_, f, h, p, t[i + 14], 9, -1019803690),
p = u(p, _, f, h, t[i + 3], 14, -187363961),
h = u(h, p, _, f, t[i + 8], 20, 1163531501),
f = u(f, h, p, _, t[i + 13], 5, -1444681467),
_ = u(_, f, h, p, t[i + 2], 9, -51403784),
p = u(p, _, f, h, t[i + 7], 14, 1735328473),
h = u(h, p, _, f, t[i + 12], 20, -1926607734),
f = c(f, h, p, _, t[i + 5], 4, -378558),
_ = c(_, f, h, p, t[i + 8], 11, -2022574463),
p = c(p, _, f, h, t[i + 11], 16, 1839030562),
h = c(h, p, _, f, t[i + 14], 23, -35309556),
f = c(f, h, p, _, t[i + 1], 4, -1530992060),
_ = c(_, f, h, p, t[i + 4], 11, 1272893353),
p = c(p, _, f, h, t[i + 7], 16, -155497632),
h = c(h, p, _, f, t[i + 10], 23, -1094730640),
f = c(f, h, p, _, t[i + 13], 4, 681279174),
_ = c(_, f, h, p, t[i], 11, -358537222),
p = c(p, _, f, h, t[i + 3], 16, -722521979),
h = c(h, p, _, f, t[i + 6], 23, 76029189),
f = c(f, h, p, _, t[i + 9], 4, -640364487),
_ = c(_, f, h, p, t[i + 12], 11, -421815835),
p = c(p, _, f, h, t[i + 15], 16, 530742520),
h = c(h, p, _, f, t[i + 2], 23, -995338651),
f = d(f, h, p, _, t[i], 6, -198630844),
_ = d(_, f, h, p, t[i + 7], 10, 1126891415),
p = d(p, _, f, h, t[i + 14], 15, -1416354905),
h = d(h, p, _, f, t[i + 5], 21, -57434055),
f = d(f, h, p, _, t[i + 12], 6, 1700485571),
_ = d(_, f, h, p, t[i + 3], 10, -1894986606),
p = d(p, _, f, h, t[i + 10], 15, -1051523),
h = d(h, p, _, f, t[i + 1], 21, -2054922799),
f = d(f, h, p, _, t[i + 8], 6, 1873313359),
_ = d(_, f, h, p, t[i + 15], 10, -30611744),
p = d(p, _, f, h, t[i + 6], 15, -1560198380),
h = d(h, p, _, f, t[i + 13], 21, 1309151649),
f = d(f, h, p, _, t[i + 4], 6, -145523070),
_ = d(_, f, h, p, t[i + 11], 10, -1120210379),
p = d(p, _, f, h, t[i + 2], 15, 718787259),
h = d(h, p, _, f, t[i + 9], 21, -343485551),
f = a(f, n),
h = a(h, s),
p = a(p, o),
_ = a(_, r);
return [f, h, p, _]
}
function p(t) {
var e, i = [];
for (i[(t.length >> 2) - 1] = void 0,
e = 0; e < i.length; e += 1)
i[e] = 0;
for (e = 0; e < 8 * t.length; e += 8)
i[e >> 5] |= (255 & t.charCodeAt(e / 8)) << e % 32;
return i
}
function h(t) {
var e, i = "";
for (e = 0; e < 32 * t.length; e += 8)
i += String.fromCharCode(t[e >> 5] >>> e % 32 & 255);
return i
}
return h(f(p(t), 8 * t.length))
}
var param=s()
console.log(param)
_signature=v.sign(i)
这里的i是第一次是0,以后是max_behot_time
v.sign函數:
function e() {
return r(e.y, arguments, k)
}
找到關鍵的函數:
(function anonymous() {
function e(e, a, r) {
return (b[e] || (b[e] = t("x,y", "return x " + e + " y")))(r, a)
}
function a(e, a, r) {
return (k[r] || (k[r] = t("x,y", "return new x[y](" + Array(r + 1).join(",x[++y]").substr(1) + ")")))(e, a)
}
function r(e, a, r) {
var n, t, s = {}, b = s.d = r ? r.d + 1 : 0;
for (s["$" + b] = s,
t = 0; t < b; t++)
s[n = "$" + t] = r[n];
for (t = 0,
b = s.length = a.length; t < b; t++)
s[t] = a[t];
return c(e, 0, s)
}
function c(t, b, k) {
function u(e) {
v[x++] = e
}
function f() {
return g = t.charCodeAt(b++) - 32,
t.substring(b, b += g)
}
function l() {
try {
y = c(t, b, k)
} catch (e) {
h = e,
y = l
}
}
for (var h, y, d, g, v = [], x = 0; ; )
switch (g = t.charCodeAt(b++) - 32) {
case 1:
u(!v[--x]);
break;
case 4:
v[x++] = f();
break;
case 5:
u(function(e) {
var a = 0
, r = e.length;
return function() {
var c = a < r;
return c && u(e[a++]),
c
}
}(v[--x]));
break;
case 6:
y = v[--x],
u(v[--x](y));
break;
case 8:
if (g = t.charCodeAt(b++) - 32,
l(),
b += g,
g = t.charCodeAt(b++) - 32,
y === c)
b += g;
else if (y !== l)
return y;
break;
case 9:
v[x++] = c;
break;
case 10:
u(s(v[--x]));
break;
case 11:
y = v[--x],
u(v[--x] + y);
break;
case 12:
for (y = f(),
d = [],
g = 0; g < y.length; g++)
d[g] = y.charCodeAt(g) ^ g + y.length;
u(String.fromCharCode.apply(null, d));
break;
case 13:
y = v[--x],
h = delete v[--x][y];
break;
case 14:
v[x++] = t.charCodeAt(b++) - 32;
break;
case 59:
u((g = t.charCodeAt(b++) - 32) ? (y = x,
v.slice(x -= g, y)) : []);
break;
case 61:
u(v[--x][t.charCodeAt(b++) - 32]);
break;
case 62:
g = v[--x],
k[0] = 65599 * k[0] + k[1].charCodeAt(g) >>> 0;
break;
case 65:
h = v[--x],
y = v[--x],
v[--x][y] = h;
break;
case 66:
u(e(t[b++], v[--x], v[--x]));
break;
case 67:
y = v[--x],
d = v[--x],
u((g = v[--x]).x === c ? r(g.y, y, k) : g.apply(d, y));
break;
case 68:
u(e((g = t[b++]) < "<" ? (b--,
f()) : g + g, v[--x], v[--x]));
break;
case 70:
u(!1);
break;
case 71:
v[x++] = n;
break;
case 72:
v[x++] = +f();
break;
case 73:
u(parseInt(f(), 36));
break;
case 75:
if (v[--x]) {
b++;
break
}
case 74:
g = t.charCodeAt(b++) - 32 << 16 >> 16,
b += g;
break;
case 76:
u(k[t.charCodeAt(b++) - 32]);
break;
case 77:
y = v[--x],
u(v[--x][y]);
break;
case 78:
g = t.charCodeAt(b++) - 32,
u(a(v, x -= g + 1, g));
break;
case 79:
g = t.charCodeAt(b++) - 32,
u(k["$" + g]);
break;
case 81:
h = v[--x],
v[--x][f()] = h;
break;
case 82:
u(v[--x][f()]);
break;
case 83:
h = v[--x],
k[t.charCodeAt(b++) - 32] = h;
break;
case 84:
v[x++] = !0;
break;
case 85:
v[x++] = void 0;
break;
case 86:
u(v[x - 1]);
break;
case 88:
h = v[--x],
y = v[--x],
v[x++] = h,
v[x++] = y;
break;
case 89:
u(function() {
function e() {
return r(e.y, arguments, k)
}
return e.y = f(),
e.x = c,
e
}());
break;
case 90:
v[x++] = null;
break;
case 91:
v[x++] = h;
break;
case 93:
h = v[--x];
break;
case 0:
return v[--x];
default:
u((g << 16 >> 16) - 16)
}
}
var n = this
, t = n.Function
, s = Object.keys || function(e) {
var a = {}
, r = 0;
for (var c in e)
a[r++] = c;
return a.length = r,
a
}
, b = {}
, k = {};
return r
}
)
在初始化的時候會執行一次init,下斷點到t = n.Function
找到關鍵代碼,這個代碼在pyv8是無法執行的,在node環境下可以執行,关键代码在这里:
Function(function(t) {
return 'e(e,a,r){(b[e]||(b[e]=t("x,y","x "+e+" y")(r,a)}a(e,a,r){(k[r]||(k[r]=t("x,y","new x[y]("+Array(r+1).join(",x[y]")(1)+")")(e,a)}r(e,a,r){n,t,s={},b=s.d=r?r.d+1:0;for(s["$"+b]=s,t=0;t>>065:h=,y=,[y]=h66:u(e(t[b],,67:y=,d=,u((g=).x===c?r(g.y,y,k):g.apply(d,y68:u(e((g=t[b])<"<"?(b--,f):g+g,,70:u(!1)71:n72:+f73:u(parseInt(f,3675:if(){bcase 74:g=<<16>>16g76:u(k[])77:y=,u([y])78:g=,u(a(v,x-=g+1,g79:g=,u(k["$"+g])81:h=,[f]=h82:u([f])83:h=,k[]=h84:!085:void 086:u(v[x-1])88:h=,y=,h,y89:u({e{r(e.y,arguments,k)}e.y=f,e.x=c,e})90:null91:h93:h=0:;default:u((g<<16>>16)-16)}}n=this,t=n.Function,s=Object.keys||(e){a={},r=0;for(c in e)a[r]=c;a=r,a},b={},k={};r'.replace(/[-]/g, function(e) {
return t[15 & e.charCodeAt(0)]
})
}("v[x++]=v[--x]t.charCodeAt(b++)-32function return ))++.substrvar .length(),b+=;break;case ;break}".split("")))()('gr$Daten Иb/s!l y͒yĹg,(lfi~ah`{mv,-n|jqewVxp{rvmmx,&effkx[!cs"l".Pq%widthl"@q&heightl"vr*getContextx$"2d[!cs#l#,*;?|u.|uc{uq$fontl#vr(fillTextx$$龘ฑภ경2<[#c}l#2q*shadowBlurl#1q-shadowOffsetXl#$$limeq+shadowColorl#vr#arcx88802[%c}l#vr&strokex[ c}l"v,)}eOmyoZB]mx[ cs!0s$l$Pb>>s!0s%yA0s"l"l!r&lengthb&l!l Bd>&+l!l &+l!l 6d>&+l!l &+ s,y=o!o!]/q"13o!l q"10o!],l 2d>& s.{s-yMo!o!]0q"13o!]*Ld>>b|s!o!l q"10o!],l!& s/yIo!o!].q"13o!],o!]*Jd>>b|&o!]+l &+ s0l-l!&l-l!i\'1z141z4b/@d
網上有分析TAC.sign的和這個是一樣的.
上述代码看不到是什么鬼,分析后后得到代码,写一个得到signature的函数,是这样的:
function get_signatrue(time) {
navigator = {};
navigator.userAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E) QQBrowser/6.9.11079.201";
Function(function(t) {
return 'function e(e, a, r) {\n' +
' return (b[e] || (b[e] = t("x,y", "return x " + e + " y")))(r, a)\n' +
' }\n' +
' function a(e, a, r) {\n' +
' return (k[r] || (k[r] = t("x,y", "return new x[y](" + Array(r + 1).join(",x[++y]").substr(1) + ")")))(e, a)\n' +
' }\n' +
' function r(e, a, r) {\n' +
' var n, t, s = {}, b = s.d = r ? r.d + 1 : 0;\n' +
' for (s["$" + b] = s,\n' +
' t = 0; t < b; t++)\n' +
' s[n = "$" + t] = r[n];\n' +
' for (t = 0,\n' +
' b = s.length = a.length; t < b; t++)\n' +
' s[t] = a[t];\n' +
' return c(e, 0, s)\n' +
' }\n' +
' function c(t, b, k) {\n' +
' function u(e) {\n' +
' v[x++] = e\n' +
' }\n' +
' function f() {\n' +
' return g = t.charCodeAt(b++) - 32,\n' +
' t.substring(b, b += g)\n' +
' }\n' +
' function l() {\n' +
' try {\n' +
' y = c(t, b, k)\n' +
' } catch (e) {\n' +
' h = e,\n' +
' y = l\n' +
' }\n' +
' }\n' +
' for (var h, y, d, g, v = [], x = 0; ; )\n' +
' switch (g = t.charCodeAt(b++) - 32) {\n' +
' case 1:\n' +
' u(!v[--x]);\n' +
' break;\n' +
' case 4:\n' +
' v[x++] = f();\n' +
' break;\n' +
' case 5:\n' +
' u(function(e) {\n' +
' var a = 0\n' +
' , r = e.length;\n' +
' return function() {\n' +
' var c = a < r;\n' +
' return c && u(e[a++]),\n' +
' c\n' +
' }\n' +
' }(v[--x]));\n' +
' break;\n' +
' case 6:\n' +
' y = v[--x],\n' +
' u(v[--x](y));\n' +
' break;\n' +
' case 8:\n' +
' if (g = t.charCodeAt(b++) - 32,\n' +
' l(),\n' +
' b += g,\n' +
' g = t.charCodeAt(b++) - 32,\n' +
' y === c)\n' +
' b += g;\n' +
' else if (y !== l)\n' +
' return y;\n' +
' break;\n' +
' case 9:\n' +
' v[x++] = c;\n' +
' break;\n' +
' case 10:\n' +
' u(s(v[--x]));\n' +
' break;\n' +
' case 11:\n' +
' y = v[--x],\n' +
' u(v[--x] + y);\n' +
' break;\n' +
' case 12:\n' +
' for (y = f(),\n' +
' d = [],\n' +
' g = 0; g < y.length; g++)\n' +
' d[g] = y.charCodeAt(g) ^ g + y.length;\n' +
' u(String.fromCharCode.apply(null, d));\n' +
' break;\n' +
' case 13:\n' +
' y = v[--x],\n' +
' h = delete v[--x][y];\n' +
' break;\n' +
' case 14:\n' +
' v[x++] = t.charCodeAt(b++) - 32;\n' +
' break;\n' +
' case 59:\n' +
' u((g = t.charCodeAt(b++) - 32) ? (y = x,\n' +
' v.slice(x -= g, y)) : []);\n' +
' break;\n' +
' case 61:\n' +
' u(v[--x][t.charCodeAt(b++) - 32]);\n' +
' break;\n' +
' case 62:\n' +
' g = v[--x],\n' +
' k[0] = 65599 * k[0] + k[1].charCodeAt(g) >>> 0;\n' +
' break;\n' +
' case 65:\n' +
' h = v[--x],\n' +
' y = v[--x],\n' +
' v[--x][y] = h;\n' +
' break;\n' +
' case 66:\n' +
' u(e(t[b++], v[--x], v[--x]));\n' +
' break;\n' +
' case 67:\n' +
' y = v[--x],\n' +
' d = v[--x],\n' +
' u((g = v[--x]).x === c ? r(g.y, y, k) : g.apply(d, y));\n' +
' break;\n' +
' case 68:\n' +
' u(e((g = t[b++]) < "<" ? (b--,\n' +
' f()) : g + g, v[--x], v[--x]));\n' +
' break;\n' +
' case 70:\n' +
' u(!1);\n' +
' break;\n' +
' case 71:\n' +
' v[x++] = n;\n' +
' break;\n' +
' case 72:\n' +
' v[x++] = +f();\n' +
' break;\n' +
' case 73:\n' +
' u(parseInt(f(), 36));\n' +
' break;\n' +
' case 75:\n' +
' if (v[--x]) {\n' +
' b++;\n' +
' break\n' +
' }\n' +
' case 74:\n' +
' g = t.charCodeAt(b++) - 32 << 16 >> 16,\n' +
' b += g;\n' +
' break;\n' +
' case 76:\n' +
' u(k[t.charCodeAt(b++) - 32]);\n' +
' break;\n' +
' case 77:\n' +
' y = v[--x],\n' +
' u(v[--x][y]);\n' +
' break;\n' +
' case 78:\n' +
' g = t.charCodeAt(b++) - 32,\n' +
' u(a(v, x -= g + 1, g));\n' +
' break;\n' +
' case 79:\n' +
' g = t.charCodeAt(b++) - 32,\n' +
' u(k["$" + g]);\n' +
' break;\n' +
' case 81:\n' +
' h = v[--x],\n' +
' v[--x][f()] = h;\n' +
' break;\n' +
' case 82:\n' +
' u(v[--x][f()]);\n' +
' break;\n' +
' case 83:\n' +
' h = v[--x],\n' +
' k[t.charCodeAt(b++) - 32] = h;\n' +
' break;\n' +
' case 84:\n' +
' v[x++] = !0;\n' +
' break;\n' +
' case 85:\n' +
' v[x++] = void 0;\n' +
' break;\n' +
' case 86:\n' +
' u(v[x - 1]);\n' +
' break;\n' +
' case 88:\n' +
' h = v[--x],\n' +
' y = v[--x],\n' +
' v[x++] = h,\n' +
' v[x++] = y;\n' +
' break;\n' +
' case 89:\n' +
' u(function() {\n' +
' function e() {\n' +
' return r(e.y, arguments, k)\n' +
' }\n' +
' return e.y = f(),\n' +
' e.x = c,\n' +
' e\n' +
' }());\n' +
' break;\n' +
' case 90:\n' +
' v[x++] = null;\n' +
' break;\n' +
' case 91:\n' +
' v[x++] = h;\n' +
' break;\n' +
' case 93:\n' +
' h = v[--x];\n' +
' break;\n' +
' case 0:\n' +
' return v[--x];\n' +
' default:\n' +
' u((g << 16 >> 16) - 16)\n' +
' }\n' +
' }\n' +
' var n = this\n' +
' , t = n.Function\n' +
' , s = Object.keys || function(e) {\n' +
' var a = {}\n' +
' , r = 0;\n' +
' for (var c in e)\n' +
' a[r++] = c;\n' +
' return a.length = r,\n' +
' a\n' +
' }\n' +
' , b = {}\n' +
' , k = {};\n' +
' return r'
}('v[x++]=,v[--x],t.charCodeAt(b++)-32,function ,return ,)),++,.substr,var ,.length,(),,b+=,;break;case ,;break}'))()('gr$Daten Иb/s!l y͒yĹg,(lfi~ah`{mv,-n|jqewVxp{rvmmx,&effkx[!cs"l".Pq%widthl"@q&heightl"vr*getContextx$"2d[!cs#l#,*;?|u.|uc{uq$fontl#vr(fillTextx$$龘ฑภ경2<[#c}l#2q*shadowBlurl#1q-shadowOffsetXl#$$limeq+shadowColorl#vr#arcx88802[%c}l#vr&strokex[ c}l"v,)}eOmyoZB]mx[ cs!0s$l$Pb>>s!0s%yA0s"l"l!r&lengthb&l!l Bd>&+l!l &+l!l 6d>&+l!l &+ s,y=o!o!]/q"13o!l q"10o!],l 2d>& s.{s-yMo!o!]0q"13o!]*Ld>>b|s!o!l q"10o!],l!& s/yIo!o!].q"13o!],o!]*Jd>>b|&o!]+l &+ s0l-l!&l-l!i\'1z141z4b/@d
使用的时候传入max_behot_time
,获取signature
头条对useragent
有检测,会封ua,明显的表现在获得到xhr链接的时候还是会出现得不到数据,由于这个原因一直还以为代码找的有问题,这个时候就需要换ua了,使用Fiddler辅助测试ua是否可用,这里不多叙述,错误的数据是这样的:
链接:https://www.toutiao.com/api/pc/feed/?max_behot_time=1540187739&category=组图&utm_source=toutiao&widen=1&tadrequire=false&_signature=sQX4ZQAA6tZO-geaiXbfQbEF-H
{"message": "error", "data": [], "has_more": false}
在Python总通过pyv8来执行js获得signature:
with PyV8.JSContext() as ctxt:
with open('./get_signatrue.js', 'r')as f:
js = f.read()
ctxt.eval(js)
get_signatrue = ctxt.locals.get_signatrue # 参数传递
signatrue=get_signatrue(0)
print signatrue
再一个就是,头条的cp和as参数可以忽略哦!!