更新 js/ksjsb_ck_x.js

This commit is contained in:
chickliu 2025-11-11 12:55:53 +08:00
parent d4521f8f03
commit 73c3908bb7

View File

@ -20,25 +20,30 @@
// ###############################
const $ = new Env();
const targetUrl = 'https://txjp.gifshow.com/rest/nebula/user/login';
// 定义需要匹配的目标URL模式数组
const targetPatterns = [
'https://txjp.gifshow.com/rest/nebula/user/login',
'https://txjp.gifshow.com/rest/n/user/login'
];
(async () => {
// 仅当 URL 匹配时执行
if ($request.url.includes(targetUrl)) {
// 检查当前URL是否匹配任一目标模式
const isMatch = targetPatterns.some(pattern => $request.url.includes(pattern));
if (isMatch) {
$.log(' 捕获到目标URL: ' + $request.url);
try {
// 1. 解析响应体
const body = JSON.parse($response.body);
// 2. 从响应体中获取 kuaishou.api_client_salt (根据你的要求)
// 使用方括号语法来访问带点的key
// 2. 从响应体中获取 kuaishou.api_client_salt
const salt = body?.['kuaishou.api_client_salt'];
if (salt) {
// 3. 获取成功,发出通知
$.log(`✅ 成功获取 kuaishou.api_client_salt: ${salt}`);
// Quantumult X 的通知点击后body 内容会自动复制到剪贴板
$.notify("快手Salt获取成功", "点击通知可复制", salt);
} else {
// 4. 获取失败,发出通知
@ -51,7 +56,7 @@ const targetUrl = 'https://txjp.gifshow.com/rest/nebula/user/login';
}
} else {
$.log('⚠️ 当前URL不匹配,脚本不执行。');
$.log('⚠️ 当前URL不匹配任何目标模式,脚本不执行。');
}
})().catch((e) => {
$.logErr(e);