更新 Scripts/nodeseek.js
This commit is contained in:
@@ -380,14 +380,30 @@ function ObjectKeys2LowerCase(obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ====================== 入口 ====================== */
|
/* ====================== 入口 ====================== */
|
||||||
|
const SCRIPT_VERSION = "v3-debug-2026-04-30";
|
||||||
|
|
||||||
!(async () => {
|
!(async () => {
|
||||||
try {
|
try {
|
||||||
|
// 版本标记 + 环境诊断(解决 "cron 误入抓 cookie 分支" 问题用)
|
||||||
|
$.log(`[VERSION] ${SCRIPT_VERSION}`);
|
||||||
|
$.log(`[ENV] $request=${typeof $request}, $response=${typeof $response}, $argument=${typeof $argument}`);
|
||||||
|
if (typeof $request !== "undefined" && $request) {
|
||||||
|
$.log(`[ENV] $request keys: ${Object.keys($request || {}).join(",")}`);
|
||||||
|
$.log(`[ENV] $request.url: ${$request.url || "<none>"}`);
|
||||||
|
}
|
||||||
|
if (typeof $response !== "undefined" && $response) {
|
||||||
|
$.log(`[ENV] $response keys: ${Object.keys($response || {}).join(",")}`);
|
||||||
|
$.log(`[ENV] $response.body length: ${$response.body ? $response.body.length : "<none>"}`);
|
||||||
|
}
|
||||||
|
|
||||||
// 判断运行模式:
|
// 判断运行模式:
|
||||||
// - http-response 脚本:$response 存在(含 body)→ 抓 cookie
|
// - http-response 脚本:$response 存在(含 body)→ 抓 cookie
|
||||||
// - cron / 手动执行 / Node.js:$response 不存在 → 签到
|
// - cron / 手动执行 / Node.js:$response 不存在 → 签到
|
||||||
// 不能用 $request 判断,因为某些 Surge 版本在 cron 里也会注入 $request
|
// 不能用 $request 判断,因为某些 Surge 版本在 cron 里也会注入 $request
|
||||||
const isMitmMode =
|
const isMitmMode =
|
||||||
typeof $response !== "undefined" && $response && $response.body;
|
typeof $response !== "undefined" && $response && $response.body;
|
||||||
|
$.log(`[ENV] isMitmMode=${isMitmMode}`);
|
||||||
|
|
||||||
if (isMitmMode) {
|
if (isMitmMode) {
|
||||||
await getCookie();
|
await getCookie();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user