yz-yuki-plugin 2.0.9-0 → 2.0.9-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -153,54 +153,12 @@ class WeiboRiskCookie {
|
|
|
153
153
|
}
|
|
154
154
|
// 简单 fingerprint(可按需增强)
|
|
155
155
|
static buildSimpleFingerprint() {
|
|
156
|
-
const randFracInt = (base, min = 0.6, max = 1) => {
|
|
157
|
-
const v = min + Math.random() * (max - min); // 0.6-1
|
|
158
|
-
return Math.floor(base * v); // 换成 Math.round(...) 或 Math.ceil(...) 根据需要
|
|
159
|
-
};
|
|
160
156
|
return JSON.stringify({
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
'4': { s: -1, v: '' },
|
|
167
|
-
'5': { s: 1, v: 33 },
|
|
168
|
-
'6': { s: -1, v: '' },
|
|
169
|
-
'7': { s: 1, v: [['zh-CN'], ['zh-CN']] },
|
|
170
|
-
'8': { s: 1, v: true },
|
|
171
|
-
'9': { s: 1, v: 'default' },
|
|
172
|
-
'10': { s: 1, v: true },
|
|
173
|
-
'11': { s: 1, v: 5 },
|
|
174
|
-
'12': { s: -1, e: '' },
|
|
175
|
-
'13': { s: 1, v: '20030107' },
|
|
176
|
-
'14': { s: -1, e: '' },
|
|
177
|
-
'15': { s: 1, v: `${WeiboApi.USER_AGENT}` },
|
|
178
|
-
'16': { s: 1, v: { vendor: 'WebKit', renderer: 'WebKit WebGL' } },
|
|
179
|
-
'17': { s: -1, v: '' },
|
|
180
|
-
'18': {
|
|
181
|
-
s: 1,
|
|
182
|
-
v: { ow: randFracInt(2235, 0.6, 1), oh: randFracInt(1210, 0.6, 1), iw: randFracInt(589, 0.6, 1), ih: randFracInt(1089, 0.6, 1) }
|
|
183
|
-
},
|
|
184
|
-
'19': { s: 1, v: 'chrome' },
|
|
185
|
-
'20': { s: 1, v: 'webkit' },
|
|
186
|
-
'21': { s: 1, v: false },
|
|
187
|
-
'22': { s: 1, v: true },
|
|
188
|
-
'23': {
|
|
189
|
-
s: 1,
|
|
190
|
-
v: { ots: false, mtp: 0, mmtp: -1 }
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
bh: {
|
|
194
|
-
mt: [],
|
|
195
|
-
kt: {
|
|
196
|
-
down: 0,
|
|
197
|
-
up: 0
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
meta: {
|
|
201
|
-
isTraceKeyboard: false,
|
|
202
|
-
isTraceMouse: false
|
|
203
|
-
}
|
|
157
|
+
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
|
|
158
|
+
platform: 'Win32',
|
|
159
|
+
screen: '1920x1080x24',
|
|
160
|
+
fonts: ['Arial', 'SimSun'],
|
|
161
|
+
plugins: []
|
|
204
162
|
});
|
|
205
163
|
}
|
|
206
164
|
// UMD 公钥 DER bytes(来自 1.2.1.umd.js 的 Uint8Array)
|
|
@@ -464,7 +422,7 @@ class WeiboRiskCookie {
|
|
|
464
422
|
const metaKey = `${key}:meta`;
|
|
465
423
|
const metaRaw = await Redis.get(metaKey);
|
|
466
424
|
const ttl = await Redis.ttl(key);
|
|
467
|
-
if (ttl > 0) {
|
|
425
|
+
if ((ttl && ttl > 0) || ttl === -1) {
|
|
468
426
|
await Redis.set(newKey, value, { EX: ttl });
|
|
469
427
|
if (metaRaw)
|
|
470
428
|
await Redis.set(`${newKey}:meta`, metaRaw, { EX: ttl });
|
|
@@ -568,6 +526,9 @@ class WeiboRiskCookie {
|
|
|
568
526
|
// 已过期,跳过
|
|
569
527
|
continue;
|
|
570
528
|
}
|
|
529
|
+
else {
|
|
530
|
+
ttl = -1; // 永不过期
|
|
531
|
+
}
|
|
571
532
|
// 构造元数据
|
|
572
533
|
const meta = JSON.stringify({
|
|
573
534
|
path: cookie.path,
|