fix: 随机cookie参数buvid3

This commit is contained in:
shanmite 2023-07-27 10:47:24 +08:00
parent 3bfc93fd4e
commit d44981b7eb
2 changed files with 15 additions and 2 deletions

View File

@ -85,6 +85,8 @@ Chrome浏览器:
只需含有 `DedeUserID=...;SESSDATA=...;bili_jct=...;buvid3=...` 即可
buvid3亦可不填 使用随机生成值
(分号分割, 不要换行, 顺序随意)
↓↓

View File

@ -1,4 +1,4 @@
const { getRemoteConfig, createDir, createFile, dyids_dir } = require("../utils");
const { getRemoteConfig, getRandomOne, createDir, createFile, dyids_dir } = require("../utils");
const config = require("../data/config");
let global_var = {
@ -30,7 +30,18 @@ let global_var = {
config.updata(num);
if (!/buvid3/.test(cookie)) {
this.set('cookie', cookie + ';buvid3=AAAAAAAA-BBBB-CCCC-DDDD-DDDDDDDDDDDDDDDDDinfoc');
const charset = "0123456789ABCDEF".split("");
const buvid3 = "x".repeat(8).split("").map(() => getRandomOne(charset)).join("")
+ "-"
+ "x".repeat(4).split("").map(() => getRandomOne(charset)).join("")
+ "-"
+ "x".repeat(4).split("").map(() => getRandomOne(charset)).join("")
+ "-"
+ "x".repeat(4).split("").map(() => getRandomOne(charset)).join("")
+ "-"
+ "x".repeat(17).split("").map(() => getRandomOne(charset)).join("")
+ "infoc";
this.set('cookie', cookie + ";" + buvid3);
} else {
this.set('cookie', cookie);
}