diff --git a/Scripts/PingMe/PingMeSignin.js b/Scripts/PingMe/PingMeSignin.js index 77be8e8e..f59a9f3a 100644 --- a/Scripts/PingMe/PingMeSignin.js +++ b/Scripts/PingMe/PingMeSignin.js @@ -2,11 +2,11 @@ @Name:PingMe 自动化签到+视频奖励 @Author:怎么肥事 https://raw.githubusercontent.com/ZenmoFeiShi/Qx/refs/heads/main/PingMe.js @modify 奶思做了修改,理论支持 Qx,Loon,Surge,Egern,ShadowRocket,青龙 -@date 2026-04-16 14:00:00 +@date 2026-04-17 14:00:00 ============QuanX============ [rewrite_local] -^https:\/\/api\.pingmeapp\.net\/app\/queryBalanceAndBonus url script-request-header https://raw.githubusercontent.com/fmz200/wool_scripts/main/Scripts/PingMe/PingMeSignin.js +^https:\/\/api\.pingmeapp\.net\/app\/queryBalanceAndBonus url script-request-header https://raw.githubusercontent.com/fmz200/wool_scripts/main/Scripts/cookie/get_cookie.js [task_local] 30 8,20 * * * https://raw.githubusercontent.com/fmz200/wool_scripts/main/Scripts/PingMe/PingMeSignin.js, img-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/PingMe.png, tag=PingMe签到, enabled=true @@ -167,7 +167,7 @@ function notifyDone(title, body) { startTasks().then(r => $.done()); async function startTasks() { - if (typeof $request !== 'undefined' && $request) { // 抓包获取签到参数 + /*if (typeof $request !== 'undefined' && $request) { // 抓包获取签到参数 console.log("开始获取签到参数"); const capture = { url: $request.url, @@ -182,7 +182,7 @@ async function startTasks() { console.log(`【${scriptName}】capture:\n${JSON.stringify(capture, null, 2)}`); // $done({}); $.done(); - } else { // 签到 + } else {*/ // 签到 console.log("开始运行签到"); // const raw = $prefs.valueForKey(ckKey); const raw = $.getdata(ckKey); @@ -291,7 +291,7 @@ async function startTasks() { } $.done(); }); - } + /*}*/ } // API start diff --git a/Scripts/cookie/get_cookie.js b/Scripts/cookie/get_cookie.js index f5066403..265b95b0 100644 --- a/Scripts/cookie/get_cookie.js +++ b/Scripts/cookie/get_cookie.js @@ -1,7 +1,7 @@ /** * @author fmz200 * @function 获取应用的cookie或token通用脚本 - * @date 2024-11-10 15:00:00 + * @date 2026-04-17 14:00:00 */ //////////////////////////////// @@ -260,6 +260,20 @@ try { } } + /** + * PingMe + */ + if (req_url.includes("/app/queryBalanceAndBonus")) { + console.log('PingMe 开始'); + const capture = { + url: req_url, + paramsRaw: parseRawQuery(req_url), + headers: normalizeHeaderNameMap(req_headers || {}) + }; + $.write(JSON.stringify(capture), 'pingme_capture_v3'); + $.notify('PingMe 获取成功✅', req_url, req_url); + console.log('PingMe 获取到的内容为:' + req_url); + } } catch (e) { console.log('脚本运行出现错误:' + e.message); $.notify('获取Cookie脚本运行出现错误❗️', "", ""); @@ -339,6 +353,26 @@ function convertDataToString(data) { return result; } +function normalizeHeaderNameMap(headers) { + const out = {}; + Object.keys(headers || {}).forEach(k => out[k] = headers[k]); + return out; +} + +function parseRawQuery(url) { + const query = (url.split('?')[1] || '').split('#')[0]; + const rawMap = {}; + query.split('&').forEach(pair => { + if (!pair) return; + const idx = pair.indexOf('='); + if (idx < 0) return; + const k = pair.slice(0, idx); + const v = pair.slice(idx + 1); + rawMap[k] = v; + }); + return rawMap; +} + /*********************************** API *************************************/ function ENV() { const e = "undefined" != typeof $task, t = "undefined" != typeof $loon, s = "undefined" != typeof $httpClient && !t, i = "function" == typeof require && "undefined" != typeof $jsbox; return { isQX: e, isLoon: t, isSurge: s, isNode: "function" == typeof require && !i, isJSBox: i, isRequest: "undefined" != typeof $request, isScriptable: "undefined" != typeof importModule } } function HTTP(e = { baseURL: "" }) { const { isQX: t, isLoon: s, isSurge: i, isScriptable: n, isNode: o } = ENV(), r = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)/; const u = {}; return ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "PATCH"].forEach(l => u[l.toLowerCase()] = (u => (function (u, l) { l = "string" == typeof l ? { url: l } : l; const h = e.baseURL; h && !r.test(l.url || "") && (l.url = h ? h + l.url : l.url); const a = (l = { ...e, ...l }).timeout, c = { onRequest: () => { }, onResponse: e => e, onTimeout: () => { }, ...l.events }; let f, d; if (c.onRequest(u, l), t) f = $task.fetch({ method: u, ...l }); else if (s || i || o) f = new Promise((e, t) => { (o ? require("request") : $httpClient)[u.toLowerCase()](l, (s, i, n) => { s ? t(s) : e({ statusCode: i.status || i.statusCode, headers: i.headers, body: n }) }) }); else if (n) { const e = new Request(l.url); e.method = u, e.headers = l.headers, e.body = l.body, f = new Promise((t, s) => { e.loadString().then(s => { t({ statusCode: e.response.statusCode, headers: e.response.headers, body: s }) }).catch(e => s(e)) }) } const p = a ? new Promise((e, t) => { d = setTimeout(() => (c.onTimeout(), t(`${u} URL: ${l.url} exceeds the timeout ${a} ms`)), a) }) : null; return (p ? Promise.race([p, f]).then(e => (clearTimeout(d), e)) : f).then(e => c.onResponse(e)) })(l, u))), u } function API(e = "untitled", t = !1) { const { isQX: s, isLoon: i, isSurge: n, isNode: o, isJSBox: r, isScriptable: u } = ENV(); return new class { constructor(e, t) { this.name = e, this.debug = t, this.http = HTTP(), this.env = ENV(), this.node = (() => { if (o) { return { fs: require("fs") } } return null })(), this.initCache(); Promise.prototype.delay = function (e) { return this.then(function (t) { return ((e, t) => new Promise(function (s) { setTimeout(s.bind(null, t), e) }))(e, t) }) } } initCache() { if (s && (this.cache = JSON.parse($prefs.valueForKey(this.name) || "{}")), (i || n) && (this.cache = JSON.parse($persistentStore.read(this.name) || "{}")), o) { let e = "root.json"; this.node.fs.existsSync(e) || this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.root = {}, e = `${this.name}.json`, this.node.fs.existsSync(e) ? this.cache = JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)) : (this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.cache = {}) } } persistCache() { const e = JSON.stringify(this.cache, null, 2); s && $prefs.setValueForKey(e, this.name), (i || n) && $persistentStore.write(e, this.name), o && (this.node.fs.writeFileSync(`${this.name}.json`, e, { flag: "w" }, e => console.log(e)), this.node.fs.writeFileSync("root.json", JSON.stringify(this.root, null, 2), { flag: "w" }, e => console.log(e))) } write(e, t) { if (this.log(`SET ${t}`), -1 !== t.indexOf("#")) { if (t = t.substr(1), n || i) return $persistentStore.write(e, t); if (s) return $prefs.setValueForKey(e, t); o && (this.root[t] = e) } else this.cache[t] = e; this.persistCache() } read(e) { return this.log(`READ ${e}`), -1 === e.indexOf("#") ? this.cache[e] : (e = e.substr(1), n || i ? $persistentStore.read(e) : s ? $prefs.valueForKey(e) : o ? this.root[e] : void 0) } delete(e) { if (this.log(`DELETE ${e}`), -1 !== e.indexOf("#")) { if (e = e.substr(1), n || i) return $persistentStore.write(null, e); if (s) return $prefs.removeValueForKey(e); o && delete this.root[e] } else delete this.cache[e]; this.persistCache() } notify(e, t = "", l = "", h = {}) { const a = h["open-url"], c = h["media-url"]; if (s && $notify(e, t, l, h), n && $notification.post(e, t, l + `${c ? "\n多媒体:" + c : ""}`, { url: a }), i) { let s = {}; a && (s.openUrl = a), c && (s.mediaUrl = c), "{}" === JSON.stringify(s) ? $notification.post(e, t, l) : $notification.post(e, t, l, s) } if (o || u) { const s = l + (a ? `\n点击跳转: ${a}` : "") + (c ? `\n多媒体: ${c}` : ""); if (r) { require("push").schedule({ title: e, body: (t ? t + "\n" : "") + s }) } else console.log(`${e}\n${t}\n${s}\n\n`) } } log(e) { this.debug && console.log(`[${this.name}] LOG: ${this.stringify(e)}`) } info(e) { console.log(`[${this.name}] INFO: ${this.stringify(e)}`) } error(e) { console.log(`[${this.name}] ERROR: ${this.stringify(e)}`) } wait(e) { return new Promise(t => setTimeout(t, e)) } done(e = {}) { console.log('done!'); s || i || n ? $done(e) : o && !r && "undefined" != typeof $context && ($context.headers = e.headers, $context.statusCode = e.statusCode, $context.body = e.body) } stringify(e) { if ("string" == typeof e || e instanceof String) return e; try { return JSON.stringify(e, null, 2) } catch (e) { return "[object Object]" } } }(e, t) } /*****************************************************************************/ diff --git a/boxjs/fmz200_boxjs.json b/boxjs/fmz200_boxjs.json index a8095712..fe525bd5 100644 --- a/boxjs/fmz200_boxjs.json +++ b/boxjs/fmz200_boxjs.json @@ -6,7 +6,7 @@ "repo": "https://github.com/fmz200/wool_scripts", "desc": "订阅大多都支持多账号,协定数据格式如下:有主键的用JSON,没有主键的拼接用#分割用@。\n例如{\"uid1\": \"token1\", \"uid2\": \"token2\",\"uid3\": \"token3\"}和uid1#token1@uid2#token2@uid3#token3", "raw": "https://raw.githubusercontent.com/fmz200/wool_scripts/refs/heads/main/boxjs/fmz200_boxjs.json", - "date": "更新日期:2025-08-10 10:00:00", + "date": "更新日期:2026-04-17 14:00:00", "apps": [ { "id": "fmz200_xiaohongshu", @@ -391,6 +391,38 @@ "https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/chery.png", "https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/chery.png" ] + },{ + "id": "fmz200_PingMe", + "name": "PingMe每日签到", + "keys": [ + "pingme_capture_v3" + ], + "descs_html": [ + "打开APP获取,可到代理工具脚本日志中查看获取到的数据" + ], + "settings": [ + { + "id": "pingme_capture_v3", + "name": "", + "val": "", + "desc": "", + "type": "textarea", + "autoGrow": true, + "rows": 8 + } + ], + "author": "@ZenmoFeiShi, @fmz200", + "repo": "https://github.com/fmz200/wool_scripts", + "scripts": [ + { + "name": "PingMe每日签到", + "script": "https://raw.githubusercontent.com/fmz200/wool_scripts/main/Scripts/PingMe/PingMeSignin.js" + } + ], + "icons": [ + "https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/PingMe.png", + "https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/PingMe.png" + ] }, { "id": "fmz200_airport_notice",