上传文件至「Scripts」
This commit is contained in:
@@ -17,18 +17,12 @@
|
||||
* - MITM 模式:访问 nodeseek 个人主页时自动抓取 cookie
|
||||
* - Cron 模式:定时执行签到
|
||||
*
|
||||
* 配置项(持久化存储 / 环境变量):
|
||||
* 配置项(优先级:$argument > 持久化存储 > 环境变量):
|
||||
* - nodeseek_data 账号数组(脚本自动写入,无需手动配置)
|
||||
* - nodeseek_default "false"=固定鸡腿(默认) / "true"=随机鸡腿
|
||||
* - is_debug "true"=输出详细日志(cookie 已脱敏)
|
||||
*
|
||||
* 重写规则(替换 <YOUR_GH_USER>/<YOUR_REPO>):
|
||||
*
|
||||
* [Script]
|
||||
* http-response ^https:\/\/www\.nodeseek\.com\/api\/account\/getInfo\/.+\?readme=1&signature=1&phone=1 script-path=https://gitea.dragonisheep.com/XXhaos/Surge/raw/branch/master/Scripts/nodeseek.js, requires-body=true, timeout=60, tag=NodeSeek获取token
|
||||
*
|
||||
* [MITM]
|
||||
* hostname = www.nodeseek.com
|
||||
* 推荐部署:使用配套的 nodeseek.sgmodule 模块文件。
|
||||
*
|
||||
* ⚠️ 仅供学习研究,使用前请阅读原作者免责声明。
|
||||
* ============================================================
|
||||
@@ -66,10 +60,32 @@ $.userList = [];
|
||||
$.notifyMsg = [];
|
||||
|
||||
const notify = $.isNode() ? require("./sendNotify") : null;
|
||||
|
||||
// 解析 Surge 模块 $argument(形如 "is_default=false&is_debug=false")
|
||||
const moduleArgs = (() => {
|
||||
const result = {};
|
||||
if (typeof $argument === "undefined" || !$argument) return result;
|
||||
String($argument)
|
||||
.split("&")
|
||||
.forEach((pair) => {
|
||||
const idx = pair.indexOf("=");
|
||||
if (idx <= 0) return;
|
||||
const k = pair.slice(0, idx).trim();
|
||||
const v = pair.slice(idx + 1).trim();
|
||||
if (k) result[k] = v;
|
||||
});
|
||||
return result;
|
||||
})();
|
||||
|
||||
// 配置读取优先级:$argument > 持久化存储 / 环境变量 > 默认值
|
||||
$.is_debug =
|
||||
($.isNode() ? process.env.IS_DEBUG : $.getdata("is_debug")) || "false";
|
||||
moduleArgs.is_debug ||
|
||||
($.isNode() ? process.env.IS_DEBUG : $.getdata("is_debug")) ||
|
||||
"false";
|
||||
$.is_default =
|
||||
($.isNode() ? process.env["nodeseek_default"] : $.getdata("nodeseek_default")) || "false";
|
||||
moduleArgs.is_default ||
|
||||
($.isNode() ? process.env["nodeseek_default"] : $.getdata("nodeseek_default")) ||
|
||||
"false";
|
||||
|
||||
/* ====================== 工具函数 ====================== */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user