From d6b64a679d195c0b89765fddeef0bf1883bb69d3 Mon Sep 17 00:00:00 2001 From: Chavy Date: Sat, 22 Aug 2020 17:06:30 +0800 Subject: [PATCH 001/348] =?UTF-8?q?=E6=9B=B4=E6=96=B0[BoxJs=20TF]:=20?= =?UTF-8?q?=E4=BE=A7=E6=A0=8F=E5=A2=9E=E5=8A=A0=E6=96=B0=E7=9A=84=E8=B4=A1?= =?UTF-8?q?=E7=8C=AE=E8=80=85=20@id77?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- box/chavy.boxjs.html | 40 ++++++++++++++++++--------------- box/chavy.boxjs.js | 6 ++--- box/release/box.release.tf.json | 14 ++++++++++++ 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/box/chavy.boxjs.html b/box/chavy.boxjs.html index 1c0884bd3..b9fc160d7 100644 --- a/box/chavy.boxjs.html +++ b/box/chavy.boxjs.html @@ -164,19 +164,19 @@ - - - - {{box.syscfgs.chavy.id}} - {{box.syscfgs.chavy.repo}} - - - - - - {{box.syscfgs.senku.id}} - {{box.syscfgs.senku.repo}} - + + + + + + + + + + + + + @@ -186,8 +186,8 @@ @@ -1248,6 +1248,7 @@

v{{ver.versio subview: null, bfsubview: null, // 数据类 + collaborators: [], contributors: [], isSaveUserCfgs: false, // 界面类 @@ -1831,7 +1832,7 @@

v{{ver.versio let bgimg = '' if (this.box.usercfgs.bgimg === '跟随系统') { const hasdark = this.bgimgs.find((bgimg) => bgimg.name == '暗黑' || bgimg.name == 'dark') - const haslight = this.bgimgs.find((bgimg) => bgimg.name == '明亮' || bgimg.name == 'light') + const haslight = this.bgimgs.find((bgimg) => bgimg.name == '明亮' || bgimg.name == 'light') const darkbgimg = hasdark ? hasdark.url : `` const lightbgimg = haslight ? haslight.url : `` this.isDarkMode ? (bgimg = darkbgimg) : (bgimg = lightbgimg) @@ -2247,9 +2248,12 @@

v{{ver.versio axios.get(url).then((resp) => { if (!resp) return resp.data.forEach((contributor) => { - if ([29748519, 39037656].includes(contributor.id)) return const { login: id, login, html_url: repo, avatar_url: icon } = contributor - this.ui.contributors.push({ id, login, repo, icon }) + if ([29748519, 39037656, 9592236].includes(contributor.id)) { + this.ui.collaborators.push({ id, login, repo, icon }) + } else { + this.ui.contributors.push({ id, login, repo, icon }) + } }) }) }, diff --git a/box/chavy.boxjs.js b/box/chavy.boxjs.js index 8be9cf186..bccea511c 100644 --- a/box/chavy.boxjs.js +++ b/box/chavy.boxjs.js @@ -3,7 +3,7 @@ const $ = new Env('BoxJs') // 为 eval 准备的上下文环境 const $eval_env = {} -$.version = '0.7.53' +$.version = '0.7.54' $.versionType = 'beta' /** @@ -278,10 +278,10 @@ function getSystemCfgs() { ], chavy: { id: 'ChavyLeung', icon: 'https://avatars3.githubusercontent.com/u/29748519', repo: 'https://github.com/chavyleung/scripts' }, senku: { id: 'GideonSenku', icon: 'https://avatars1.githubusercontent.com/u/39037656', repo: 'https://github.com/GideonSenku' }, + id77: { id: 'id77', icon: 'https://avatars0.githubusercontent.com/u/9592236', repo: 'https://github.com/id77' }, orz3: { id: 'Orz-3', icon: 'https://raw.githubusercontent.com/Orz-3/task/master/Orz-3.png', repo: 'https://github.com/Orz-3/' }, boxjs: { id: 'BoxJs', show: false, icon: 'https://raw.githubusercontent.com/Orz-3/task/master/box.png', icons: ['https://raw.githubusercontent.com/Orz-3/mini/master/box.png', 'https://raw.githubusercontent.com/Orz-3/task/master/box.png'], repo: 'https://github.com/chavyleung/scripts' }, - defaultIcons: ['https://raw.githubusercontent.com/Orz-3/mini/master/appstore.png', 'https://raw.githubusercontent.com/Orz-3/task/master/appstore.png'], - scontributors: [] + defaultIcons: ['https://raw.githubusercontent.com/Orz-3/mini/master/appstore.png', 'https://raw.githubusercontent.com/Orz-3/task/master/appstore.png'] } } diff --git a/box/release/box.release.tf.json b/box/release/box.release.tf.json index b9fe15a9a..0d1e192f3 100644 --- a/box/release/box.release.tf.json +++ b/box/release/box.release.tf.json @@ -1,5 +1,19 @@ { "releases": [ + { + "version": "0.7.54", + "tags": ["beta"], + "author": "@GideonSenku", + "icon": "https://avatars3.githubusercontent.com/u/29748519", + "repo": "https://github.com/chavyleung", + "msg": "更新[BoxJs TF]: 侧栏增加新的贡献者 @id77", + "notes": [ + { + "name": "贡献者", + "descs": ["新的贡献者 @id77"] + } + ] + }, { "version": "0.7.53", "tags": ["beta"], From 2ca8d40a93c93ea03c9d7b49d735a536039bf597 Mon Sep 17 00:00:00 2001 From: Chavy Date: Sat, 22 Aug 2020 19:22:40 +0800 Subject: [PATCH 002/348] =?UTF-8?q?=E6=9B=B4=E6=96=B0[BoxJs=20TF]:=20?= =?UTF-8?q?=E9=A1=B6=E6=A0=8F=E5=92=8C=E5=BA=95=E6=A0=8F=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=B7=9F=E9=9A=8F=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- box/chavy.boxjs.html | 94 +++++++++++++++++++++++++++------ box/chavy.boxjs.js | 2 +- box/release/box.release.tf.json | 14 ++++- 3 files changed, 92 insertions(+), 18 deletions(-) diff --git a/box/chavy.boxjs.html b/box/chavy.boxjs.html index b9fc160d7..f02d5db1e 100644 --- a/box/chavy.boxjs.html +++ b/box/chavy.boxjs.html @@ -93,7 +93,13 @@
- + - + - + mdi-delete-circle-outline diff --git a/box/chavy.boxjs.js b/box/chavy.boxjs.js index 8356a0448..1bd55591b 100644 --- a/box/chavy.boxjs.js +++ b/box/chavy.boxjs.js @@ -3,7 +3,7 @@ const $ = new Env('BoxJs') // 为 eval 准备的上下文环境 const $eval_env = {} -$.version = '0.19.23' +$.version = '0.19.24' $.versionType = 'beta' // 发出的请求需要需要 Surge、QuanX 的 rewrite diff --git a/box/release/box.release.json b/box/release/box.release.json index c7779b9a0..ebe96956e 100644 --- a/box/release/box.release.json +++ b/box/release/box.release.json @@ -1,5 +1,17 @@ { "releases": [ + { + "version": "0.19.24", + "tags": ["beta"], + "author": "@id77", + "msg": "feat(boxjs): isEditFavApp 只在主页才显示", + "notes": [ + { + "name": "优化", + "descs": ["悬浮按钮的收藏编辑功能只在主页才显示"] + } + ] + }, { "version": "0.19.23", "tags": ["beta"], diff --git a/box/release/box.release.tf.json b/box/release/box.release.tf.json index 7fe43bc51..dbbf6410b 100644 --- a/box/release/box.release.tf.json +++ b/box/release/box.release.tf.json @@ -1,5 +1,17 @@ { "releases": [ + { + "version": "0.19.24", + "tags": ["beta"], + "author": "@id77", + "msg": "feat(boxjs): isEditFavApp 只在主页才显示", + "notes": [ + { + "name": "优化", + "descs": ["悬浮按钮的收藏编辑功能只在主页才显示"] + } + ] + }, { "version": "0.19.23", "tags": ["beta"], From c14f160dae0257a9ab62d4b55898885dbb5c123a Mon Sep 17 00:00:00 2001 From: id77 <9592236+id77@users.noreply.github.com> Date: Sat, 26 Apr 2025 17:19:32 +0800 Subject: [PATCH 336/348] =?UTF-8?q?feat(boxjs):=20=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BB=85=E4=BD=BF=E7=94=A8=E5=92=8C=E5=85=B3?= =?UTF-8?q?=E8=81=94=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅使用会话数据,应用设置修改保存不更新原会话;关联使用会话数据,应用设置修改保存会更新原会话 --- box/chavy.boxjs.html | 66 ++++++++++++++++++++++++++------- box/chavy.boxjs.js | 2 +- box/release/box.release.json | 12 ++++++ box/release/box.release.tf.json | 12 ++++++ 4 files changed, 77 insertions(+), 15 deletions(-) diff --git a/box/chavy.boxjs.html b/box/chavy.boxjs.html index c6561ebe4..106c40bc5 100644 --- a/box/chavy.boxjs.html +++ b/box/chavy.boxjs.html @@ -1249,7 +1249,8 @@

{{curapp.name}}

{{dayjs(session.createTime).format('YYYY-MM-DD HH:mm:ss')}} - {{ $t('base.dialog.apply') }} + {{ $t('base.dialog.use') }} + {{ $t('base.dialog.link') }} @@ -1467,7 +1468,9 @@

v{{ver.versio save: 'Save', view: 'View', close: 'Close', - ok: 'OK' + ok: 'OK', + use: 'Use', + link: 'Link' }, sort: { up: 'Up', @@ -1630,7 +1633,9 @@

v{{ver.versio apply: '应用', save: '保存', close: '关闭', - ok: '好' + ok: '好', + use: '使用', + link: '关联' }, sort: { up: '上移', @@ -2840,20 +2845,53 @@

v{{ver.versio }, // 使用应用会话 useAppSession(sessionId) { - const sessions = this.box.sessions - const session = sessions.find((session) => session.id === sessionId) - this.box.curSessions[session.appId] = sessionId + const sessions = JSON.parse(JSON.stringify(this.box.sessions)); + const session = sessions.find( + (session) => session.id === sessionId + ); + + const datas = session.datas; + delete this.box.curSessions[session.appId]; + const key = 'chavy_boxjs_cur_sessions'; + const val = JSON.stringify({}); + datas.push({ key, val }); + + if (session) { + axios + .post(`/api/save?appid=${this.curapp.id}`, datas) + .then((resp) => { + if (this.curapp.id === 'BoxSetting') { + this.isSaveUserCfgs = false; + } else { + delete resp.data.usercfgs; + } + Object.assign(this.box, resp.data); + + if (this.curapp.id === 'BoxSetting') { + this.setHttpBackend(); + } + }); + } + }, + // 关联应用会话 + linkAppSession(sessionId) { + const sessions = JSON.parse(JSON.stringify(this.box.sessions)); + const session = sessions.find( + (session) => session.id === sessionId + ); - const key = 'chavy_boxjs_cur_sessions' - const val = JSON.stringify(this.box.curSessions) - const curSessions = [{ key, val }] - const datas = [...session.datas, ...curSessions] + const datas = session.datas; + // 记录当前应用正在使用的会话ID + this.box.curSessions[session.appId] = sessionId; + const key = 'chavy_boxjs_cur_sessions'; + const val = JSON.stringify(this.box.curSessions); + datas.push({ key, val }); - this.clearAppDatas() + // 发送单个合并请求,避免竞争条件 axios.post('/api/save', datas).then((resp) => { - delete resp.data.usercfgs - Object.assign(this.box, resp.data) - }) + delete resp.data.usercfgs; + Object.assign(this.box, resp.data); + }); }, // 复制应用数据为对象数据 copyData(curdata) { diff --git a/box/chavy.boxjs.js b/box/chavy.boxjs.js index 1bd55591b..44f9d6a08 100644 --- a/box/chavy.boxjs.js +++ b/box/chavy.boxjs.js @@ -3,7 +3,7 @@ const $ = new Env('BoxJs') // 为 eval 准备的上下文环境 const $eval_env = {} -$.version = '0.19.24' +$.version = '0.19.25' $.versionType = 'beta' // 发出的请求需要需要 Surge、QuanX 的 rewrite diff --git a/box/release/box.release.json b/box/release/box.release.json index ebe96956e..89156f133 100644 --- a/box/release/box.release.json +++ b/box/release/box.release.json @@ -1,5 +1,17 @@ { "releases": [ + { + "version": "0.19.25", + "tags": ["beta"], + "author": "@id77", + "msg": "feat(boxjs): 会话支持仅使用和关联使用", + "notes": [ + { + "name": "优化", + "descs": ["仅使用会话数据,应用设置修改保存不更新原会话;关联使用会话数据,应用设置修改保存会更新原会话"] + } + ] + }, { "version": "0.19.24", "tags": ["beta"], diff --git a/box/release/box.release.tf.json b/box/release/box.release.tf.json index dbbf6410b..6b8dbdf3a 100644 --- a/box/release/box.release.tf.json +++ b/box/release/box.release.tf.json @@ -1,5 +1,17 @@ { "releases": [ + { + "version": "0.19.25", + "tags": ["beta"], + "author": "@id77", + "msg": "feat(boxjs): 会话支持仅使用和关联使用", + "notes": [ + { + "name": "优化", + "descs": ["仅使用会话数据,应用设置修改保存不更新原会话;关联使用会话数据,应用设置修改保存会更新原会话"] + } + ] + }, { "version": "0.19.24", "tags": ["beta"], From 0cf9879a278b4e16dd57e13ecc8aa877f566cb83 Mon Sep 17 00:00:00 2001 From: MartinsKing <42362589+ClydeTime@users.noreply.github.com> Date: Wed, 7 May 2025 17:19:13 +0800 Subject: [PATCH 337/348] Fix: msg notification call exception (#511) --- Env.js | 25 ++++++++++++------------- Env.min.js | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Env.js b/Env.js index e3432a00b..d2ed4cbfd 100644 --- a/Env.js +++ b/Env.js @@ -676,19 +676,20 @@ function Env(name, opts) { Object.assign(options, { action: 'clipboard', text: copy }) } - if ($media) { - let mediaUrl = undefined + // 图片通知 + let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] || $media + if (mediaUrl) { let media = undefined let mime = undefined // http 开头的网络地址 - if ($media.startsWith('http')) { - mediaUrl = $media + if (mediaUrl.startsWith('http')) { + //不做任何操作 } // 带标识的 Base64 字符串 // data:image/png;base64,iVBORw0KGgo... - else if ($media.startsWith('data:')) { - const [data] = $media.split(';') - const [, base64str] = $media.split(',') + else if (mediaUrl.startsWith('data:')) { + const [data] = mediaUrl.split(';') + const [, base64str] = mediaUrl.split(',') media = base64str mime = data.replace('data:', '') } @@ -711,8 +712,8 @@ function Env(name, opts) { } return null } - media = $media - mime = getMimeFromBase64($media) + media = mediaUrl + mime = getMimeFromBase64(mediaUrl) } Object.assign(options, { @@ -735,8 +736,7 @@ function Env(name, opts) { rawopts.openUrl || rawopts.url || rawopts['open-url'] || $open if (openUrl) Object.assign(options, { openUrl }) - let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] - if ($media?.startsWith('http')) mediaUrl = $media + let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] || $media if (mediaUrl) Object.assign(options, { mediaUrl }) console.log(JSON.stringify(options)) @@ -749,8 +749,7 @@ function Env(name, opts) { rawopts['open-url'] || rawopts.url || rawopts.openUrl || $open if (openUrl) Object.assign(options, { 'open-url': openUrl }) - let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl - if ($media?.startsWith('http')) mediaUrl = $media + let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] || $media if (mediaUrl) Object.assign(options, { 'media-url': mediaUrl }) let copy = diff --git a/Env.min.js b/Env.min.js index b64b5e469..0d0bc12f4 100644 --- a/Env.min.js +++ b/Env.min.js @@ -1 +1 @@ -function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;"POST"===e&&(s=this.post);const i=new Promise(((e,i)=>{s.call(this,t,((t,s,o)=>{t?i(t):e(s)}))}));return t.timeout?((t,e=1e3)=>Promise.race([t,new Promise(((t,s)=>{setTimeout((()=>{s(new Error("请求超时"))}),e)}))]))(i,t.timeout):i}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise((e=>{this.get({url:t},((t,s,i)=>e(i)))}))}runScript(t,e){return new Promise((s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,a]=i.split("@"),n={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,Accept:"*/*"},policy:"DIRECT",timeout:o};this.post(n,((t,e,i)=>s(i)))})).catch((t=>this.logErr(t)))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}lodash_set(t,e,s){return Object(t)!==t||(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce(((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{}),t)[e[e.length-1]]=s),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),a=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),i)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueForKey(t,e);case"Node.js":return this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0;default:return this.data&&this.data[e]||null}}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.cookie&&void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar)))}get(t,e=(()=>{})){switch(t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"],delete t.headers["content-type"],delete t.headers["content-length"]),t.params&&(t.url+="?"+this.queryStr(t.params)),void 0===t.followRedirect||t.followRedirect||((this.isSurge()||this.isLoon())&&(t["auto-redirect"]=!1),this.isQuanX()&&(t.opts?t.opts.redirection=!1:t.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,((t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,i)}));break;case"Quantumult X":this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then((t=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=t;e(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(t=>e(t&&t.error||"UndefinedError")));break;case"Node.js":let s=require("iconv-lite");this.initGotEnv(t),this.got(t).on("redirect",((t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}})).then((t=>{const{statusCode:i,statusCode:o,headers:r,rawBody:a}=t,n=s.decode(a,this.encoding);e(null,{status:i,statusCode:o,headers:r,rawBody:a,body:n},n)}),(t=>{const{message:i,response:o}=t;e(i,o,o&&s.decode(o.rawBody,this.encoding))}));break}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";switch(t.body&&t.headers&&!t.headers["Content-Type"]&&!t.headers["content-type"]&&(t.headers["content-type"]="application/x-www-form-urlencoded"),t.headers&&(delete t.headers["Content-Length"],delete t.headers["content-length"]),void 0===t.followRedirect||t.followRedirect||((this.isSurge()||this.isLoon())&&(t["auto-redirect"]=!1),this.isQuanX()&&(t.opts?t.opts.redirection=!1:t.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](t,((t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,i)}));break;case"Quantumult X":t.method=s,this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then((t=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=t;e(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(t=>e(t&&t.error||"UndefinedError")));break;case"Node.js":let i=require("iconv-lite");this.initGotEnv(t);const{url:o,...r}=t;this.got[s](o,r).then((t=>{const{statusCode:s,statusCode:o,headers:r,rawBody:a}=t,n=i.decode(a,this.encoding);e(null,{status:s,statusCode:o,headers:r,rawBody:a,body:n},n)}),(t=>{const{message:s,response:o}=t;e(s,o,o&&i.decode(o.rawBody,this.encoding))}));break}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}queryStr(t){let e="";for(const s in t){let i=t[s];null!=i&&""!==i&&("object"==typeof i&&(i=JSON.stringify(i)),e+=`${s}=${i}&`)}return e=e.substring(0,e.length-1),e}msg(e=t,s="",i="",o={}){const r=t=>{const{$open:e,$copy:s,$media:i,$mediaMime:o}=t;switch(typeof t){case void 0:return t;case"string":switch(this.getEnv()){case"Surge":case"Stash":default:return{url:t};case"Loon":case"Shadowrocket":return t;case"Quantumult X":return{"open-url":t};case"Node.js":return}case"object":switch(this.getEnv()){case"Surge":case"Stash":case"Shadowrocket":default:{const r={};let a=t.openUrl||t.url||t["open-url"]||e;a&&Object.assign(r,{action:"open-url",url:a});let n=t["update-pasteboard"]||t.updatePasteboard||s;if(n&&Object.assign(r,{action:"clipboard",text:n}),i){let t,e,s;if(i.startsWith("http"))t=i;else if(i.startsWith("data:")){const[t]=i.split(";"),[,o]=i.split(",");e=o,s=t.replace("data:","")}else{e=i,s=(t=>{const e={JVBERi0:"application/pdf",R0lGODdh:"image/gif",R0lGODlh:"image/gif",iVBORw0KGgo:"image/png","/9j/":"image/jpg"};for(var s in e)if(0===t.indexOf(s))return e[s];return null})(i)}Object.assign(r,{"media-url":t,"media-base64":e,"media-base64-mime":o??s})}return Object.assign(r,{"auto-dismiss":t["auto-dismiss"],sound:t.sound}),r}case"Loon":{const s={};let o=t.openUrl||t.url||t["open-url"]||e;o&&Object.assign(s,{openUrl:o});let r=t.mediaUrl||t["media-url"];return i?.startsWith("http")&&(r=i),r&&Object.assign(s,{mediaUrl:r}),console.log(JSON.stringify(s)),s}case"Quantumult X":{const o={};let r=t["open-url"]||t.url||t.openUrl||e;r&&Object.assign(o,{"open-url":r});let a=t["media-url"]||t.mediaUrl;i?.startsWith("http")&&(a=i),a&&Object.assign(o,{"media-url":a});let n=t["update-pasteboard"]||t.updatePasteboard||s;return n&&Object.assign(o,{"update-pasteboard":n}),console.log(JSON.stringify(o)),o}case"Node.js":return}default:return}};if(!this.isMute)switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:$notification.post(e,s,i,r(o));break;case"Quantumult X":$notify(e,s,i,r(o));break;case"Node.js":break}if(!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}debug(...t){this.logLevels[this.logLevel]<=this.logLevels.debug&&(t.length>0&&(this.logs=[...this.logs,...t]),console.log(`${this.logLevelPrefixs.debug}${t.map((t=>t??String(t))).join(this.logSeparator)}`))}info(...t){this.logLevels[this.logLevel]<=this.logLevels.info&&(t.length>0&&(this.logs=[...this.logs,...t]),console.log(`${this.logLevelPrefixs.info}${t.map((t=>t??String(t))).join(this.logSeparator)}`))}warn(...t){this.logLevels[this.logLevel]<=this.logLevels.warn&&(t.length>0&&(this.logs=[...this.logs,...t]),console.log(`${this.logLevelPrefixs.warn}${t.map((t=>t??String(t))).join(this.logSeparator)}`))}error(...t){this.logLevels[this.logLevel]<=this.logLevels.error&&(t.length>0&&(this.logs=[...this.logs,...t]),console.log(`${this.logLevelPrefixs.error}${t.map((t=>t??String(t))).join(this.logSeparator)}`))}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.map((t=>t??String(t))).join(this.logSeparator))}logErr(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:this.log("",`❗️${this.name}, 错误!`,e,t);break;case"Node.js":this.log("",`❗️${this.name}, 错误!`,e,void 0!==t.message?t.message:t,t.stack);break}}wait(t){return new Promise((e=>setTimeout(e,t)))}done(t={}){const e=((new Date).getTime()-this.startTime)/1e3;switch(this.log("",`🔔${this.name}, 结束! 🕛 ${e} 秒`),this.log(),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:$done(t);break;case"Node.js":process.exit(1)}}}(t,e)} \ No newline at end of file +function Env(e,t){class s{constructor(e){this.env=e}send(e,t="GET"){e="string"==typeof e?{url:e}:e;let s=this.get;"POST"===t&&(s=this.post);const i=new Promise(((t,i)=>{s.call(this,e,((e,s,o)=>{e?i(e):t(s)}))}));return e.timeout?((e,t=1e3)=>Promise.race([e,new Promise(((e,s)=>{setTimeout((()=>{s(new Error("请求超时"))}),t)}))]))(i,e.timeout):i}get(e){return this.send.call(this.env,e)}post(e){return this.send.call(this.env,e,"POST")}}return new class{constructor(e,t){this.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",this.name=e,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,t),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(e,t=null){try{return JSON.parse(e)}catch{return t}}toStr(e,t=null,...s){try{return JSON.stringify(e,...s)}catch{return t}}getjson(e,t){let s=t;if(this.getdata(e))try{s=JSON.parse(this.getdata(e))}catch{}return s}setjson(e,t){try{return this.setdata(JSON.stringify(e),t)}catch{return!1}}getScript(e){return new Promise((t=>{this.get({url:e},((e,s,i)=>t(i)))}))}runScript(e,t){return new Promise((s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=t&&t.timeout?t.timeout:o;const[r,a]=i.split("@"),n={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:e,mock_type:"cron",timeout:o},headers:{"X-Key":r,Accept:"*/*"},policy:"DIRECT",timeout:o};this.post(n,((e,t,i)=>s(i)))})).catch((e=>this.logErr(e)))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const e=this.path.resolve(this.dataFile),t=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(e),i=!s&&this.fs.existsSync(t);if(!s&&!i)return{};{const i=s?e:t;try{return JSON.parse(this.fs.readFileSync(i))}catch(e){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const e=this.path.resolve(this.dataFile),t=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(e),i=!s&&this.fs.existsSync(t),o=JSON.stringify(this.data);s?this.fs.writeFileSync(e,o):i?this.fs.writeFileSync(t,o):this.fs.writeFileSync(e,o)}}lodash_get(e,t,s){const i=t.replace(/\[(\d+)\]/g,".$1").split(".");let o=e;for(const e of i)if(o=Object(o)[e],void 0===o)return s;return o}lodash_set(e,t,s){return Object(e)!==e||(Array.isArray(t)||(t=t.toString().match(/[^.[\]]+/g)||[]),t.slice(0,-1).reduce(((e,s,i)=>Object(e[s])===e[s]?e[s]:e[s]=Math.abs(t[i+1])>>0==+t[i+1]?[]:{}),e)[t[t.length-1]]=s),e}getdata(e){let t=this.getval(e);if(/^@/.test(e)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(e),o=s?this.getval(s):"";if(o)try{const e=JSON.parse(o);t=e?this.lodash_get(e,i,""):t}catch(e){t=""}}return t}setdata(e,t){let s=!1;if(/^@/.test(t)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(t),r=this.getval(i),a=i?"null"===r?null:r||"{}":"{}";try{const t=JSON.parse(a);this.lodash_set(t,o,e),s=this.setval(JSON.stringify(t),i)}catch(t){const r={};this.lodash_set(r,o,e),s=this.setval(JSON.stringify(r),i)}}else s=this.setval(e,t);return s}getval(e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(e);case"Quantumult X":return $prefs.valueForKey(e);case"Node.js":return this.data=this.loaddata(),this.data[e];default:return this.data&&this.data[e]||null}}setval(e,t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(e,t);case"Quantumult X":return $prefs.setValueForKey(e,t);case"Node.js":return this.data=this.loaddata(),this.data[t]=e,this.writedata(),!0;default:return this.data&&this.data[t]||null}}initGotEnv(e){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,e&&(e.headers=e.headers?e.headers:{},e&&(e.headers=e.headers?e.headers:{},void 0===e.headers.cookie&&void 0===e.headers.Cookie&&void 0===e.cookieJar&&(e.cookieJar=this.ckjar)))}get(e,t=(()=>{})){switch(e.headers&&(delete e.headers["Content-Type"],delete e.headers["Content-Length"],delete e.headers["content-type"],delete e.headers["content-length"]),e.params&&(e.url+="?"+this.queryStr(e.params)),void 0===e.followRedirect||e.followRedirect||((this.isSurge()||this.isLoon())&&(e["auto-redirect"]=!1),this.isQuanX()&&(e.opts?e.opts.redirection=!1:e.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(e,((e,s,i)=>{!e&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),t(e,s,i)}));break;case"Quantumult X":this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((e=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=e;t(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(e=>t(e&&e.error||"UndefinedError")));break;case"Node.js":let s=require("iconv-lite");this.initGotEnv(e),this.got(e).on("redirect",((e,t)=>{try{if(e.headers["set-cookie"]){const s=e.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),t.cookieJar=this.ckjar}}catch(e){this.logErr(e)}})).then((e=>{const{statusCode:i,statusCode:o,headers:r,rawBody:a}=e,n=s.decode(a,this.encoding);t(null,{status:i,statusCode:o,headers:r,rawBody:a,body:n},n)}),(e=>{const{message:i,response:o}=e;t(i,o,o&&s.decode(o.rawBody,this.encoding))}));break}}post(e,t=(()=>{})){const s=e.method?e.method.toLocaleLowerCase():"post";switch(e.body&&e.headers&&!e.headers["Content-Type"]&&!e.headers["content-type"]&&(e.headers["content-type"]="application/x-www-form-urlencoded"),e.headers&&(delete e.headers["Content-Length"],delete e.headers["content-length"]),void 0===e.followRedirect||e.followRedirect||((this.isSurge()||this.isLoon())&&(e["auto-redirect"]=!1),this.isQuanX()&&(e.opts?e.opts.redirection=!1:e.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](e,((e,s,i)=>{!e&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),t(e,s,i)}));break;case"Quantumult X":e.method=s,this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((e=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=e;t(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(e=>t(e&&e.error||"UndefinedError")));break;case"Node.js":let i=require("iconv-lite");this.initGotEnv(e);const{url:o,...r}=e;this.got[s](o,r).then((e=>{const{statusCode:s,statusCode:o,headers:r,rawBody:a}=e,n=i.decode(a,this.encoding);t(null,{status:s,statusCode:o,headers:r,rawBody:a,body:n},n)}),(e=>{const{message:s,response:o}=e;t(s,o,o&&i.decode(o.rawBody,this.encoding))}));break}}time(e,t=null){const s=t?new Date(t):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let t in i)new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?i[t]:("00"+i[t]).substr((""+i[t]).length)));return e}queryStr(e){let t="";for(const s in e){let i=e[s];null!=i&&""!==i&&("object"==typeof i&&(i=JSON.stringify(i)),t+=`${s}=${i}&`)}return t=t.substring(0,t.length-1),t}msg(t=e,s="",i="",o={}){const r=e=>{const{$open:t,$copy:s,$media:i,$mediaMime:o}=e;switch(typeof e){case void 0:return e;case"string":switch(this.getEnv()){case"Surge":case"Stash":default:return{url:e};case"Loon":case"Shadowrocket":return e;case"Quantumult X":return{"open-url":e};case"Node.js":return}case"object":switch(this.getEnv()){case"Surge":case"Stash":case"Shadowrocket":default:{const r={};let a=e.openUrl||e.url||e["open-url"]||t;a&&Object.assign(r,{action:"open-url",url:a});let n=e["update-pasteboard"]||e.updatePasteboard||s;n&&Object.assign(r,{action:"clipboard",text:n});let h=e.mediaUrl||e["media-url"]||i;if(h){let e,t;if(h.startsWith("http"));else if(h.startsWith("data:")){const[s]=h.split(";"),[,i]=h.split(",");e=i,t=s.replace("data:","")}else{e=h,t=(e=>{const t={JVBERi0:"application/pdf",R0lGODdh:"image/gif",R0lGODlh:"image/gif",iVBORw0KGgo:"image/png","/9j/":"image/jpg"};for(var s in t)if(0===e.indexOf(s))return t[s];return null})(h)}Object.assign(r,{"media-url":h,"media-base64":e,"media-base64-mime":o??t})}return Object.assign(r,{"auto-dismiss":e["auto-dismiss"],sound:e.sound}),r}case"Loon":{const s={};let o=e.openUrl||e.url||e["open-url"]||t;o&&Object.assign(s,{openUrl:o});let r=e.mediaUrl||e["media-url"]||i;return r&&Object.assign(s,{mediaUrl:r}),console.log(JSON.stringify(s)),s}case"Quantumult X":{const o={};let r=e["open-url"]||e.url||e.openUrl||t;r&&Object.assign(o,{"open-url":r});let a=e.mediaUrl||e["media-url"]||i;a&&Object.assign(o,{"media-url":a});let n=e["update-pasteboard"]||e.updatePasteboard||s;return n&&Object.assign(o,{"update-pasteboard":n}),console.log(JSON.stringify(o)),o}case"Node.js":return}default:return}};if(!this.isMute)switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:$notification.post(t,s,i,r(o));break;case"Quantumult X":$notify(t,s,i,r(o));break;case"Node.js":break}if(!this.isMuteLog){let e=["","==============📣系统通知📣=============="];e.push(t),s&&e.push(s),i&&e.push(i),console.log(e.join("\n")),this.logs=this.logs.concat(e)}}debug(...e){this.logLevels[this.logLevel]<=this.logLevels.debug&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.debug}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}info(...e){this.logLevels[this.logLevel]<=this.logLevels.info&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.info}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}warn(...e){this.logLevels[this.logLevel]<=this.logLevels.warn&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.warn}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}error(...e){this.logLevels[this.logLevel]<=this.logLevels.error&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.error}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}log(...e){e.length>0&&(this.logs=[...this.logs,...e]),console.log(e.map((e=>e??String(e))).join(this.logSeparator))}logErr(e,t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:this.log("",`❗️${this.name}, 错误!`,t,e);break;case"Node.js":this.log("",`❗️${this.name}, 错误!`,t,void 0!==e.message?e.message:e,e.stack);break}}wait(e){return new Promise((t=>setTimeout(t,e)))}done(e={}){const t=((new Date).getTime()-this.startTime)/1e3;switch(this.log("",`🔔${this.name}, 结束! 🕛 ${t} 秒`),this.log(),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:$done(e);break;case"Node.js":process.exit(1)}}}(e,t)} \ No newline at end of file From eecdc39a407df13734d5ef276d5917f107393e91 Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Tue, 11 Nov 2025 13:36:27 +0800 Subject: [PATCH 338/348] fix: citybox api host --- citybox/citybox.cookie.js | 6 +++--- citybox/citybox.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/citybox/citybox.cookie.js b/citybox/citybox.cookie.js index 1800835e8..4c66d42c7 100644 --- a/citybox/citybox.cookie.js +++ b/citybox/citybox.cookie.js @@ -3,15 +3,15 @@ * hostname = api.icitybox.cn * * # Surge - * Rewrite: citybox = type=http-request,pattern=^https:\/\/api\.icitybox\.cn\/index.php\/api\/user\/get_user_info,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js,debug=true + * Rewrite: citybox = type=http-request,pattern=^https:\/\/api\.icitybox\/api\/user\/get_user_info,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js,debug=true * Tasks: citybox-签到 = type=cron,cronexp=10 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.js,wake-system=true * * # QuanX - * ^https:\/\/api\.icitybox\.cn\/index.php\/api\/user\/get_user_info url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js + * ^https:\/\/api\.icitybox\/api\/user\/get_user_info url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js * 10 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.js, tag=citybox-签到 * * # Loon - * http-request ^https:\/\/api\.icitybox\.cn\/index.php\/api\/user\/get_user_infoscript-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js, tag=citybox + * http-request ^https:\/\/api\.icitybox\/api\/user\/get_user_infoscript-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js, tag=citybox * cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.js * * # 获取方式:进入签到页面获取,进入citybox小程序即可 diff --git a/citybox/citybox.js b/citybox/citybox.js index f5f0707d7..1461bd71e 100644 --- a/citybox/citybox.js +++ b/citybox/citybox.js @@ -1,5 +1,5 @@ const $ = new Env('魔盒') -const hostApi = 'https://api.icitybox.cn/index.php/api' +const hostApi = 'https://api.icitybox.cn/api' const drawRes = [] !(async () => { From 1d691675451bf0416f4e7619c61b2ea057a9fbbd Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Wed, 11 Feb 2026 15:09:45 +0800 Subject: [PATCH 339/348] feat(zxhc): migrate to m.suanya.cn and support version-agnostic path - switch cookie/rewrite from m.ctrip.com to m.suanya.cn - use \d+ in URL pattern for soa2 version number - update Surge/QuanX/Loon task and cookie configs --- Loon.cookie.conf | 4 +- QuantumultX_AppStore_Local_Cookie.conf | 4 +- QuantumultX_Local_Cookie.conf | 4 +- surge.cookies.sgmodule | 4 +- surge.tasks.sgmodule | 1 + zxhc/README.md | 12 +-- zxhc/zxhc.cookie.js | 70 +++--------- zxhc/zxhc.js | 141 ++++++++++++++----------- 8 files changed, 109 insertions(+), 131 deletions(-) diff --git a/Loon.cookie.conf b/Loon.cookie.conf index db5ef4628..937a175d7 100644 --- a/Loon.cookie.conf +++ b/Loon.cookie.conf @@ -61,6 +61,6 @@ http-request ^https:\/\/user-api-prd-mx\.wandafilm\.com script-path=https://raw. http-request ^https:\/\/wx-mini.pagoda.com.cn\/api\/v1\/wxmini\/signIn\/customer script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/pagoda/pagoda.cookie.js, tag=百果园 http-response ^https:\/\/my\.ruanmei\.com\/api\/usersign\/getsigninfo? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ithome/ithome.cookie.js, tag=IT之家 http-response ^http:\/\/api\.infzm\.com\/mobile\/pumpkin_task\/complete? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nfzm/nfzm.cookie.js ,tag=南方周末 -http-request ^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js, tag=智行火车票 +http-request ^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js, tag=智行火车票 -hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, node.kg.qq.com, api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com +hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.suanya.cn, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, node.kg.qq.com, api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com diff --git a/QuantumultX_AppStore_Local_Cookie.conf b/QuantumultX_AppStore_Local_Cookie.conf index e45108b50..534b2472b 100644 --- a/QuantumultX_AppStore_Local_Cookie.conf +++ b/QuantumultX_AppStore_Local_Cookie.conf @@ -1,7 +1,7 @@ # 本配置适用于: QuanX 商店版 v1.0.6-build194 及之前版本 # 如果你是TF版, 请使用: QuantumultX_Local_Cookie.conf -hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, gdws.nsenz.com, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com +hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.suanya.cn, 110.43.90.61, zt.wps.cn, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, gdws.nsenz.com, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com # 电信营业厅 ^https:\/\/wapside.189.cn:9001\/api\/home\/sign url script-request-body chavyleung/10000/10000.cookie.js @@ -133,7 +133,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc ^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list url script-request-header chavyleung/wps/wps.cookie.js #智行火车 -^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? url script-request-body chavyleung/zxhc/zxhc.cookie.js +^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay url script-request-body chavyleung/zxhc/zxhc.cookie.js # 苏宁易购 ^https:\/\/passport.suning.com\/ids\/login$ url script-request-body chavyleung/suning/suning.cookie.js diff --git a/QuantumultX_Local_Cookie.conf b/QuantumultX_Local_Cookie.conf index 69a5ef0d2..befe447bd 100644 --- a/QuantumultX_Local_Cookie.conf +++ b/QuantumultX_Local_Cookie.conf @@ -1,7 +1,7 @@ # 本配置适用于: QuanX TestFlight v1.0.6-build195 及以后版本 # 如果你是商店版, 请使用: QuantumultX_AppStore_Local_Cookie.conf -hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, node.kg.qq.com, api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com +hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.suanya.cn, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, node.kg.qq.com, api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com # 电信营业厅 ^https:\/\/wapside.189.cn:9001\/api\/home\/sign url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js @@ -125,7 +125,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc ^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js #智行火车 -^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js +^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js # 苏宁易购 ^https:\/\/passport.suning.com\/ids\/login$ url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js diff --git a/surge.cookies.sgmodule b/surge.cookies.sgmodule index 4260de509..836f08279 100644 --- a/surge.cookies.sgmodule +++ b/surge.cookies.sgmodule @@ -47,8 +47,8 @@ Rewrite: 蔚来 = type=http-request,pattern=^https:\/\/app\.nio\.com\/api\/1\/ap Rewrite: 喜马拉雅 = type=http-request,pattern=^https?:\/\/.*\/mobile\-user\/(v1\/)?homePage\/.*,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js Rewrite: 字幕组 = type=http-request,pattern=^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js Rewrite: 字幕组 = type=http-request,pattern=^https?:\/\/(www\.)?rrys2020\.com\/?.?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js -Rewrite: 智行火车 = type=http-request,pattern=^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js,requires-body=true +Rewrite: 智行火车 = type=http-request,pattern=^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js,requires-body=true Rewrite: citybox = type=http-request,pattern=^https:\/\/api\.icitybox\.cn\/index.php\/api\/user\/get_user_info,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js,debug=true [MITM] -hostname = %INSERT%, apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, node.kg.qq.com, api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com \ No newline at end of file +hostname = %INSERT%, apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.suanya.cn, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, node.kg.qq.com, api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, m.client.10010.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, 113.96.156.178, *.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com \ No newline at end of file diff --git a/surge.tasks.sgmodule b/surge.tasks.sgmodule index d1edf170a..2b7ce5d75 100644 --- a/surge.tasks.sgmodule +++ b/surge.tasks.sgmodule @@ -29,6 +29,7 @@ Tasks: 顺丰速运 = type=cron,cronexp=6 0 * * *,script-path=https://raw.github Tasks: 网易云音乐 = type=cron,cronexp=1 7 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js,wake-system=true Tasks: 字幕组 = type=cron,cronexp=3 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.js,wake-system=true Tasks: citybox-签到 = type=cron,cronexp=10 10 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.js,wake-system=true +Tasks: 智行火车 = type=cron,cronexp=10 8 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.js,wake-system=true # Tasks: 美团外卖 = type=cron,cronexp=8 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.js Rewrite: 头脑吃鸡 = type=http-response,pattern=^https://tncj.hortorgames.com/chicken/fight/(answer|findQuiz),script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tncj/tncj.min.js,requires-body=true,max-size=0 diff --git a/zxhc/README.md b/zxhc/README.md index 0f27a376e..ea5c3b712 100644 --- a/zxhc/README.md +++ b/zxhc/README.md @@ -10,10 +10,10 @@ ```properties [MITM] -m.ctrip.com +m.suanya.cn [Script] -http-request ^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js, requires-body=true +http-request ^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js, requires-body=true cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.js ``` @@ -22,13 +22,13 @@ cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scr ```properties [MITM] -m.ctrip.com +m.suanya.cn [rewrite_local] #&QuanX -^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? url script-request-body chavyleung/zxhc/zxhc.cookie.js +^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay url script-request-body chavyleung/zxhc/zxhc.cookie.js # QuanTF -^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js +^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js [task_local] 1 0 * * * zxhc.js @@ -39,7 +39,7 @@ m.ctrip.com ## 说明 -1. 先把`m.ctrip.com`加到`[MITM]` +1. 先把`m.suanya.cn`加到`[MITM]` 2. 再配置重写规则: - Surge: 把两条远程脚本放到`[Script]` - QuanX: 把`zxhc.cookie.js`和`zxhc.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) diff --git a/zxhc/zxhc.cookie.js b/zxhc/zxhc.cookie.js index 9ec48f59e..185df9be7 100644 --- a/zxhc/zxhc.cookie.js +++ b/zxhc/zxhc.cookie.js @@ -1,61 +1,19 @@ -const cookieName = '智行火车' +const $ = new Env('智行火车') const signurlKey = 'senku_signurl_zxhc' const signheaderKey = 'senku_signheader_zxhc' const signbodyKey = 'senku_signbody_zxhc' -const senku = init() -const requrl = $request.url -if ($request && $request.method != 'OPTIONS') { - const signurlVal = requrl - const signheaderVal = JSON.stringify($request.headers) - const signbodyVal = $request.body - if (signurlVal) senku.setdata(signurlVal, signurlKey) - if (signheaderVal) senku.setdata(signheaderVal, signheaderKey) - if (signbodyVal) senku.setdata(signbodyVal, signbodyKey) - senku.msg(cookieName, `获取Cookie: 成功`, ``) -} +!(async () => { + if ($request && $request.method != 'OPTIONS') { + const signheaderVal = JSON.stringify($request.headers) + const signbodyVal = $request.body || '' + if (signheaderVal) $.setdata(signheaderVal, signheaderKey) + if (signbodyVal) $.setdata(signbodyVal, signbodyKey) + $.msg($.name, '获取Cookie: 成功', '') + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) -function init() { - isSurge = () => { - return undefined === this.$httpClient ? false : true - } - isQuanX = () => { - return undefined === this.$task ? false : true - } - getdata = (key) => { - if (isSurge()) return $persistentStore.read(key) - if (isQuanX()) return $prefs.valueForKey(key) - } - setdata = (key, val) => { - if (isSurge()) return $persistentStore.write(key, val) - if (isQuanX()) return $prefs.setValueForKey(key, val) - } - msg = (title, subtitle, body) => { - if (isSurge()) $notification.post(title, subtitle, body) - if (isQuanX()) $notify(title, subtitle, body) - } - log = (message) => console.log(message) - get = (url, cb) => { - if (isSurge()) { - $httpClient.get(url, cb) - } - if (isQuanX()) { - url.method = 'GET' - $task.fetch(url).then((resp) => cb(null, {}, resp.body)) - } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, {}, resp.body)) - } - } - done = (value = {}) => { - $done(value) - } - return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } -} -senku.done() +// prettier-ignore +function Env(e,t){class s{constructor(e){this.env=e}send(e,t="GET"){e="string"==typeof e?{url:e}:e;let s=this.get;"POST"===t&&(s=this.post);const i=new Promise(((t,i)=>{s.call(this,e,((e,s,o)=>{e?i(e):t(s)}))}));return e.timeout?((e,t=1e3)=>Promise.race([e,new Promise(((e,s)=>{setTimeout((()=>{s(new Error("请求超时"))}),t)}))]))(i,e.timeout):i}get(e){return this.send.call(this.env,e)}post(e){return this.send.call(this.env,e,"POST")}}return new class{constructor(e,t){this.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",this.name=e,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,t),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(e,t=null){try{return JSON.parse(e)}catch{return t}}toStr(e,t=null,...s){try{return JSON.stringify(e,...s)}catch{return t}}getjson(e,t){let s=t;if(this.getdata(e))try{s=JSON.parse(this.getdata(e))}catch{}return s}setjson(e,t){try{return this.setdata(JSON.stringify(e),t)}catch{return!1}}getScript(e){return new Promise((t=>{this.get({url:e},((e,s,i)=>t(i)))}))}runScript(e,t){return new Promise((s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=t&&t.timeout?t.timeout:o;const[r,a]=i.split("@"),n={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:e,mock_type:"cron",timeout:o},headers:{"X-Key":r,Accept:"*/*"},policy:"DIRECT",timeout:o};this.post(n,((e,t,i)=>s(i)))})).catch((e=>this.logErr(e)))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const e=this.path.resolve(this.dataFile),t=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(e),i=!s&&this.fs.existsSync(t);if(!s&&!i)return{};{const i=s?e:t;try{return JSON.parse(this.fs.readFileSync(i))}catch(e){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const e=this.path.resolve(this.dataFile),t=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(e),i=!s&&this.fs.existsSync(t),o=JSON.stringify(this.data);s?this.fs.writeFileSync(e,o):i?this.fs.writeFileSync(t,o):this.fs.writeFileSync(e,o)}}lodash_get(e,t,s){const i=t.replace(/\[(\d+)\]/g,".$1").split(".");let o=e;for(const e of i)if(o=Object(o)[e],void 0===o)return s;return o}lodash_set(e,t,s){return Object(e)!==e||(Array.isArray(t)||(t=t.toString().match(/[^.[\]]+/g)||[]),t.slice(0,-1).reduce(((e,s,i)=>Object(e[s])===e[s]?e[s]:e[s]=Math.abs(t[i+1])>>0==+t[i+1]?[]:{}),e)[t[t.length-1]]=s),e}getdata(e){let t=this.getval(e);if(/^@/.test(e)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(e),o=s?this.getval(s):"";if(o)try{const e=JSON.parse(o);t=e?this.lodash_get(e,i,""):t}catch(e){t=""}}return t}setdata(e,t){let s=!1;if(/^@/.test(t)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(t),r=this.getval(i),a=i?"null"===r?null:r||"{}":"{}";try{const t=JSON.parse(a);this.lodash_set(t,o,e),s=this.setval(JSON.stringify(t),i)}catch(t){const r={};this.lodash_set(r,o,e),s=this.setval(JSON.stringify(r),i)}}else s=this.setval(e,t);return s}getval(e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(e);case"Quantumult X":return $prefs.valueForKey(e);case"Node.js":return this.data=this.loaddata(),this.data[e];default:return this.data&&this.data[e]||null}}setval(e,t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(e,t);case"Quantumult X":return $prefs.setValueForKey(e,t);case"Node.js":return this.data=this.loaddata(),this.data[t]=e,this.writedata(),!0;default:return this.data&&this.data[t]||null}}initGotEnv(e){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,e&&(e.headers=e.headers?e.headers:{},e&&(e.headers=e.headers?e.headers:{},void 0===e.headers.cookie&&void 0===e.headers.Cookie&&void 0===e.cookieJar&&(e.cookieJar=this.ckjar)))}get(e,t=(()=>{})){switch(e.headers&&(delete e.headers["Content-Type"],delete e.headers["Content-Length"],delete e.headers["content-type"],delete e.headers["content-length"]),e.params&&(e.url+="?"+this.queryStr(e.params)),void 0===e.followRedirect||e.followRedirect||((this.isSurge()||this.isLoon())&&(e["auto-redirect"]=!1),this.isQuanX()&&(e.opts?e.opts.redirection=!1:e.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(e,((e,s,i)=>{!e&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),t(e,s,i)}));break;case"Quantumult X":this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((e=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=e;t(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(e=>t(e&&e.error||"UndefinedError")));break;case"Node.js":let s=require("iconv-lite");this.initGotEnv(e),this.got(e).on("redirect",((e,t)=>{try{if(e.headers["set-cookie"]){const s=e.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),t.cookieJar=this.ckjar}}catch(e){this.logErr(e)}})).then((e=>{const{statusCode:i,statusCode:o,headers:r,rawBody:a}=e,n=s.decode(a,this.encoding);t(null,{status:i,statusCode:o,headers:r,rawBody:a,body:n},n)}),(e=>{const{message:i,response:o}=e;t(i,o,o&&s.decode(o.rawBody,this.encoding))}));break}}post(e,t=(()=>{})){const s=e.method?e.method.toLocaleLowerCase():"post";switch(e.body&&e.headers&&!e.headers["Content-Type"]&&!e.headers["content-type"]&&(e.headers["content-type"]="application/x-www-form-urlencoded"),e.headers&&(delete e.headers["Content-Length"],delete e.headers["content-length"]),void 0===e.followRedirect||e.followRedirect||((this.isSurge()||this.isLoon())&&(e["auto-redirect"]=!1),this.isQuanX()&&(e.opts?e.opts.redirection=!1:e.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](e,((e,s,i)=>{!e&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),t(e,s,i)}));break;case"Quantumult X":e.method=s,this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((e=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=e;t(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(e=>t(e&&e.error||"UndefinedError")));break;case"Node.js":let i=require("iconv-lite");this.initGotEnv(e);const{url:o,...r}=e;this.got[s](o,r).then((e=>{const{statusCode:s,statusCode:o,headers:r,rawBody:a}=e,n=i.decode(a,this.encoding);t(null,{status:s,statusCode:o,headers:r,rawBody:a,body:n},n)}),(e=>{const{message:s,response:o}=e;t(s,o,o&&i.decode(o.rawBody,this.encoding))}));break}}time(e,t=null){const s=t?new Date(t):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let t in i)new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?i[t]:("00"+i[t]).substr((""+i[t]).length)));return e}queryStr(e){let t="";for(const s in e){let i=e[s];null!=i&&""!==i&&("object"==typeof i&&(i=JSON.stringify(i)),t+=`${s}=${i}&`)}return t=t.substring(0,t.length-1),t}msg(t=e,s="",i="",o={}){const r=e=>{const{$open:t,$copy:s,$media:i,$mediaMime:o}=e;switch(typeof e){case void 0:return e;case"string":switch(this.getEnv()){case"Surge":case"Stash":default:return{url:e};case"Loon":case"Shadowrocket":return e;case"Quantumult X":return{"open-url":e};case"Node.js":return}case"object":switch(this.getEnv()){case"Surge":case"Stash":case"Shadowrocket":default:{const r={};let a=e.openUrl||e.url||e["open-url"]||t;a&&Object.assign(r,{action:"open-url",url:a});let n=e["update-pasteboard"]||e.updatePasteboard||s;n&&Object.assign(r,{action:"clipboard",text:n});let h=e.mediaUrl||e["media-url"]||i;if(h){let e,t;if(h.startsWith("http"));else if(h.startsWith("data:")){const[s]=h.split(";"),[,i]=h.split(",");e=i,t=s.replace("data:","")}else{e=h,t=(e=>{const t={JVBERi0:"application/pdf",R0lGODdh:"image/gif",R0lGODlh:"image/gif",iVBORw0KGgo:"image/png","/9j/":"image/jpg"};for(var s in t)if(0===e.indexOf(s))return t[s];return null})(h)}Object.assign(r,{"media-url":h,"media-base64":e,"media-base64-mime":o??t})}return Object.assign(r,{"auto-dismiss":e["auto-dismiss"],sound:e.sound}),r}case"Loon":{const s={};let o=e.openUrl||e.url||e["open-url"]||t;o&&Object.assign(s,{openUrl:o});let r=e.mediaUrl||e["media-url"]||i;return r&&Object.assign(s,{mediaUrl:r}),console.log(JSON.stringify(s)),s}case"Quantumult X":{const o={};let r=e["open-url"]||e.url||e.openUrl||t;r&&Object.assign(o,{"open-url":r});let a=e.mediaUrl||e["media-url"]||i;a&&Object.assign(o,{"media-url":a});let n=e["update-pasteboard"]||e.updatePasteboard||s;return n&&Object.assign(o,{"update-pasteboard":n}),console.log(JSON.stringify(o)),o}case"Node.js":return}default:return}};if(!this.isMute)switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:$notification.post(t,s,i,r(o));break;case"Quantumult X":$notify(t,s,i,r(o));break;case"Node.js":break}if(!this.isMuteLog){let e=["","==============📣系统通知📣=============="];e.push(t),s&&e.push(s),i&&e.push(i),console.log(e.join("\n")),this.logs=this.logs.concat(e)}}debug(...e){this.logLevels[this.logLevel]<=this.logLevels.debug&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.debug}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}info(...e){this.logLevels[this.logLevel]<=this.logLevels.info&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.info}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}warn(...e){this.logLevels[this.logLevel]<=this.logLevels.warn&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.warn}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}error(...e){this.logLevels[this.logLevel]<=this.logLevels.error&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.error}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}log(...e){e.length>0&&(this.logs=[...this.logs,...e]),console.log(e.map((e=>e??String(e))).join(this.logSeparator))}logErr(e,t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:this.log("",`❗️${this.name}, 错误!`,t,e);break;case"Node.js":this.log("",`❗️${this.name}, 错误!`,t,void 0!==e.message?e.message:e,e.stack);break}}wait(e){return new Promise((t=>setTimeout(t,e)))}done(e={}){const t=((new Date).getTime()-this.startTime)/1e3;switch(this.log("",`🔔${this.name}, 结束! 🕛 ${t} 秒`),this.log(),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:$done(e);break;case"Node.js":process.exit(1)}}}(e,t)} diff --git a/zxhc/zxhc.js b/zxhc/zxhc.js index 236ae83bb..a19d8f687 100644 --- a/zxhc/zxhc.js +++ b/zxhc/zxhc.js @@ -1,75 +1,94 @@ -const cookieName = '智行火车' -const signurlKey = 'senku_signurl_zxhc' +const $ = new Env('智行火车') const signheaderKey = 'senku_signheader_zxhc' const signbodyKey = 'senku_signbody_zxhc' -const senku = init() -const signurlVal = senku.getdata(signurlKey) -const signheaderVal = senku.getdata(signheaderKey) -const signBodyVal = senku.getdata(signbodyKey) +// 若智行更换 soa2 版本号,请将 18903 改为新版本号 +const signURL = 'https://m.suanya.cn/restapi/soa2/18903/attendanceDay' +const creditURL = 'https://m.suanya.cn/restapi/soa2/17679/get2020ZtripIntergrationDailyAttendanceInfo' -sign() +!(async () => { + const signResult = await sign() + if (signResult === null) { + showmsg(null, null) + return + } + const creditInfo = await getCreditInfo() + showmsg(signResult, creditInfo) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) function sign() { - const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal } - senku.post(url, (error, response, data) => { - senku.log(`${cookieName}, data: ${data}`) - const res = JSON.parse(data) - let subTitle = `` - let detail = `` - if (res.resultCode == 0) { - subTitle = `签到结果: 成功` - detail = `积分: ${res.credit}` - if (res.coupon!=null) { - detail += `优惠券:${res.coupon}` - } - } else if (res.resultCode == -1) {}{ - subTitle = `签到结果: ${res.resultMessage}` + return new Promise((resolve) => { + const signheaderVal = $.getdata(signheaderKey) + const signBodyVal = $.getdata(signbodyKey) + if (!signheaderVal || !signBodyVal) { + return resolve(null) + } + const opts = { + url: signURL, + headers: JSON.parse(signheaderVal), + body: signBodyVal, } - senku.msg(cookieName, subTitle, detail) - senku.done() + $.post(opts, (err, resp, data) => { + try { + $.log(`${$.name}, sign data: ${data}`) + const res = $.toObj(data, {}) + const ok = res.resultCode === 1 || res.resultCode === 0 + const message = res.resultMessage || res.message || (ok ? '成功' : '失败') + resolve({ ok, message }) + } catch (e) { + $.logErr(e, data) + resolve({ ok: false, message: '解析失败' }) + } + }) }) } -function init() { - isSurge = () => { - return undefined === this.$httpClient ? false : true - } - isQuanX = () => { - return undefined === this.$task ? false : true - } - getdata = (key) => { - if (isSurge()) return $persistentStore.read(key) - if (isQuanX()) return $prefs.valueForKey(key) - } - setdata = (key, val) => { - if (isSurge()) return $persistentStore.write(key, val) - if (isQuanX()) return $prefs.setValueForKey(key, val) - } - msg = (title, subtitle, body) => { - if (isSurge()) $notification.post(title, subtitle, body) - if (isQuanX()) $notify(title, subtitle, body) - } - log = (message) => console.log(message) - get = (url, cb) => { - if (isSurge()) { - $httpClient.get(url, cb) +function getCreditInfo() { + return new Promise((resolve) => { + const creditHeaderVal = $.getdata(signheaderKey) + const creditBodyVal = $.getdata(signbodyKey) || '' + if (!creditHeaderVal || !creditBodyVal) { + return resolve({ credit: null, coupon: null }) } - if (isQuanX()) { - url.method = 'GET' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) + const opts = { + url: creditURL, + headers: $.toObj(creditHeaderVal, {}), + body: creditBodyVal, } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) + $.post(opts, (err, resp, data) => { + try { + if (err || !data) return resolve({ credit: null, coupon: null }) + $.log(`${$.name}, credit data: ${data}`) + const res = $.toObj(data, {}) + const credit = res.credit ?? res.point ?? res.integral ?? null + const coupon = res.coupon ?? res.couponCount ?? null + resolve({ credit, coupon }) + } catch (e) { + $.logErr(e, data) + resolve({ credit: null, coupon: null }) + } + }) + }) +} + +function showmsg(signResult, creditInfo) { + let subTitle = '' + let detail = '' + if (signResult === null) { + subTitle = '' + detail = '请先获取 Cookie' + } else { + subTitle = `签到结果: ${signResult.resultMessage}` + if (creditInfo && (creditInfo.credit != null || creditInfo.coupon != null)) { + const parts = [] + if (creditInfo.credit != null) parts.push(`积分: ${creditInfo.credit}`) + if (creditInfo.coupon != null) parts.push(`优惠券: ${creditInfo.coupon}`) + detail = parts.join(' ') } } - done = (value = {}) => { - $done(value) - } - return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } + $.msg($.name, subTitle, detail) } + +// prettier-ignore +function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} \ No newline at end of file From a28ac462905ebdc0dbfe4c8254823202cc86533d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 17:34:01 +0800 Subject: [PATCH 340/348] chore(deps): bump lodash from 4.17.21 to 4.17.23 (#516) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- yarn.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index c013d2a4b..05093c251 100644 --- a/package-lock.json +++ b/package-lock.json @@ -487,9 +487,9 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", "license": "MIT" }, "node_modules/lowercase-keys": { diff --git a/yarn.lock b/yarn.lock index ba944d948..ff9ebbd43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -296,9 +296,9 @@ keyv@^4.0.0: json-buffer "3.0.1" lodash@^4.17.14: - version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + version "4.17.23" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.23.tgz#f113b0378386103be4f6893388c73d0bde7f2c5a" + integrity sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w== lowercase-keys@^2.0.0: version "2.0.0" From 2f0330bec31291bd1528533896c3c5aebf2487bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 17:34:10 +0800 Subject: [PATCH 341/348] chore(deps): bump qs from 6.11.0 to 6.14.1 (#515) Bumps [qs](https://github.com/ljharb/qs) from 6.11.0 to 6.14.1. - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.11.0...v6.14.1) --- updated-dependencies: - dependency-name: qs dependency-version: 6.14.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 254 ++++++++++++++++++++++++++++++++++++++-------- yarn.lock | 172 +++++++++++++++++++++++-------- 2 files changed, 342 insertions(+), 84 deletions(-) diff --git a/package-lock.json b/package-lock.json index 05093c251..51247838b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -145,14 +145,30 @@ "node": ">=8" } }, - "node_modules/call-bind": { + "node_modules/call-bind-apply-helpers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -255,6 +271,20 @@ "node": ">=10" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -264,6 +294,36 @@ "once": "^1.4.0" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -290,25 +350,51 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "license": "MIT" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -324,6 +410,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/got": { "version": "11.8.5", "resolved": "https://registry.npmjs.org/got/-/got-11.8.5.tgz", @@ -349,18 +447,6 @@ "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -370,9 +456,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -381,6 +467,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -501,6 +599,15 @@ "node": ">=8" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -561,10 +668,13 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -651,12 +761,12 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.14.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", + "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.1.0" }, "engines": { "node": ">=0.6" @@ -722,14 +832,72 @@ "license": "MIT" }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" diff --git a/yarn.lock b/yarn.lock index ff9ebbd43..622645c65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -87,13 +87,21 @@ cacheable-request@^7.0.2: normalize-url "^6.0.1" responselike "^2.0.0" -call-bind@^1.0.0: +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" + es-errors "^1.3.0" + function-bind "^1.1.2" + +call-bound@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== + dependencies: + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" chalk@^4.1.2: version "4.1.2" @@ -151,6 +159,15 @@ defer-to-connect@^2.0.0: resolved "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.0.tgz" integrity sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg== +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" @@ -158,6 +175,23 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" @@ -168,19 +202,34 @@ follow-redirects@^1.0.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -get-intrinsic@^1.0.2: - version "1.1.3" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz" - integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +get-intrinsic@^1.2.5, get-intrinsic@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.3" + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" get-stream@^5.1.0: version "5.2.0" @@ -189,6 +238,11 @@ get-stream@^5.1.0: dependencies: pump "^3.0.0" +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + got@^11.8.5: version "11.8.5" resolved "https://registry.npmjs.org/got/-/got-11.8.5.tgz" @@ -211,17 +265,17 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== +has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" he@^1.2.0: version "1.2.0" @@ -305,6 +359,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + mime@^1.6.0: version "1.6.0" resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" @@ -342,10 +401,10 @@ normalize-url@^6.0.1: resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== -object-inspect@^1.9.0: - version "1.12.2" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.13.3: + version "1.13.4" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" + integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== once@^1.3.1, once@^1.4.0: version "1.4.0" @@ -397,11 +456,11 @@ punycode@^2.1.1: integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== qs@^6.4.0: - version "6.11.0" - resolved "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + version "6.14.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.1.tgz#a41d85b9d3902f31d27861790506294881871159" + integrity sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ== dependencies: - side-channel "^1.0.4" + side-channel "^1.1.0" querystringify@^2.1.1: version "2.2.0" @@ -445,14 +504,45 @@ secure-compare@3.0.1: resolved "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz" integrity sha1-8aAymzCLIh+uN7mXTz1XjQypmeM= -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== +side-channel-list@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" + integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + +side-channel-map@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" + integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + +side-channel-weakmap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" + integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + side-channel-map "^1.0.1" + +side-channel@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" + integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + side-channel-list "^1.0.0" + side-channel-map "^1.0.1" + side-channel-weakmap "^1.0.2" supports-color@^7.1.0: version "7.2.0" From b52a78ea92aeea41b8b32d05b28b39e5ef9dccf5 Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Wed, 11 Feb 2026 19:13:01 +0800 Subject: [PATCH 342/348] =?UTF-8?q?chore:=20archive=20=E4=B8=8D=E8=83=8C?= =?UTF-8?q?=E5=8D=95=E8=AF=8D=20(bubei)=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move bubei/ to achived/bubei/ - Comment out bubei in Loon.cookie.conf and Loon.task.conf --- Loon.cookie.conf | 2 +- Loon.task.conf | 2 +- {bubei => achived/bubei}/README.md | 0 {bubei => achived/bubei}/bubei.js | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename {bubei => achived/bubei}/README.md (100%) rename {bubei => achived/bubei}/bubei.js (100%) diff --git a/Loon.cookie.conf b/Loon.cookie.conf index 937a175d7..08bfb316c 100644 --- a/Loon.cookie.conf +++ b/Loon.cookie.conf @@ -49,7 +49,7 @@ http-request ^https:\/\/luckman.suning.com\/luck-web\/sign\/api\/clock_sign.do s http-request ^https:\/\/sign.suning.com\/sign-web\/m\/promotion\/sign\/doSign.do script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js, tag=苏宁易购 http-request ^https:\/\/gameapi.suning.com\/sngame-web\/(api\/signin\/private\/customerSignOperation.do|gateway\/api\/queryPrize.do) script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js, tag=苏宁易购 http-request ^https:\/\/iphone\.myzaker\.com\/zaker\/sign_in\/\/api\/sign_in\.php script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zaker/zaker.js, tag=Zaker -http-request ^https:\/\/sapi\.beingfine\.cn\/v3\/bb\/reward\/by-sign-in script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bubei/bubei.js, tag=不背单词 +# http-request ^https:\/\/sapi\.beingfine\.cn\/v3\/bb\/reward\/by-sign-in script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bubei/bubei.js, tag=不背单词 [archived] http-request ^https:\/\/gameapi\.hellobike\.com\/api script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hellobike/hellobike.js, requires-body=true, tag=哈啰出行 http-request ^https:\/\/mwegame\.qq\.com\/ams\/sign\/doSign\/month script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zsfc/zsfc.js, tag=掌上飞车 http-request ^https:\/\/apiwz\.midukanshu\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/midu/midu.cookie.js, requires-body=true, tag=米读 diff --git a/Loon.task.conf b/Loon.task.conf index 8fad48658..de151565a 100644 --- a/Loon.task.conf +++ b/Loon.task.conf @@ -44,7 +44,7 @@ cron "40 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scr cron "50 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.js,tag=智行火车 cron "0 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.js,tag=苏宁易购 cron "10 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zaker/zaker.js,tag=Zaker -cron "20 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bubei/bubei.js,tag=不背单词 +# cron "20 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bubei/bubei.js,tag=不背单词 [archived] cron "40 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hellobike/hellobike.js,tag=哈啰出行 cron "50 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zsfc/zsfc.js,tag=掌上飞车 cron "0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.js,tag=多看 diff --git a/bubei/README.md b/achived/bubei/README.md similarity index 100% rename from bubei/README.md rename to achived/bubei/README.md diff --git a/bubei/bubei.js b/achived/bubei/bubei.js similarity index 100% rename from bubei/bubei.js rename to achived/bubei/bubei.js From ef2e50d8b7acd20311b4996d4d8733f467dafb42 Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Thu, 12 Feb 2026 11:41:06 +0800 Subject: [PATCH 343/348] fix(zxhc): showmsg func --- zxhc/zxhc.js | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/zxhc/zxhc.js b/zxhc/zxhc.js index a19d8f687..d8a8b9f6b 100644 --- a/zxhc/zxhc.js +++ b/zxhc/zxhc.js @@ -6,13 +6,9 @@ const signURL = 'https://m.suanya.cn/restapi/soa2/18903/attendanceDay' const creditURL = 'https://m.suanya.cn/restapi/soa2/17679/get2020ZtripIntergrationDailyAttendanceInfo' !(async () => { - const signResult = await sign() - if (signResult === null) { - showmsg(null, null) - return - } - const creditInfo = await getCreditInfo() - showmsg(signResult, creditInfo) + await sign() + await getCreditInfo() + showmsg() })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -32,13 +28,14 @@ function sign() { $.post(opts, (err, resp, data) => { try { $.log(`${$.name}, sign data: ${data}`) - const res = $.toObj(data, {}) - const ok = res.resultCode === 1 || res.resultCode === 0 - const message = res.resultMessage || res.message || (ok ? '成功' : '失败') - resolve({ ok, message }) + const res = JSON.parse(data) + $.sign = res + resolve() } catch (e) { $.logErr(e, data) - resolve({ ok: false, message: '解析失败' }) + reject(e) + } finally { + resolve() } }) }) @@ -60,30 +57,30 @@ function getCreditInfo() { try { if (err || !data) return resolve({ credit: null, coupon: null }) $.log(`${$.name}, credit data: ${data}`) - const res = $.toObj(data, {}) - const credit = res.credit ?? res.point ?? res.integral ?? null - const coupon = res.coupon ?? res.couponCount ?? null - resolve({ credit, coupon }) + const res = JSON.parse(data) + $.credit = res + resolve() } catch (e) { $.logErr(e, data) - resolve({ credit: null, coupon: null }) + } finally { + resolve() } }) }) } -function showmsg(signResult, creditInfo) { +function showmsg() { let subTitle = '' let detail = '' - if (signResult === null) { - subTitle = '' + if (!$.sign) { + subTitle = '签到: 失败' detail = '请先获取 Cookie' } else { - subTitle = `签到结果: ${signResult.resultMessage}` - if (creditInfo && (creditInfo.credit != null || creditInfo.coupon != null)) { + subTitle = `签到: ${$.sign.resultMessage}` + if ($.credit && ($.credit.credit != null || $.credit.coupon != null)) { const parts = [] - if (creditInfo.credit != null) parts.push(`积分: ${creditInfo.credit}`) - if (creditInfo.coupon != null) parts.push(`优惠券: ${creditInfo.coupon}`) + if ($.credit.credit != null) parts.push(`积分: ${$.credit.credit}`) + if ($.credit.coupon != null) parts.push(`优惠券: ${$.credit.coupon}`) detail = parts.join(' ') } } From 1a3210c476e5ed22c0563708020aaf6648d19d30 Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Fri, 13 Feb 2026 16:48:52 +0800 Subject: [PATCH 344/348] feat: tongcheng trip --- tongcheng-trip/tongcheng-trip.js | 207 +++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 tongcheng-trip/tongcheng-trip.js diff --git a/tongcheng-trip/tongcheng-trip.js b/tongcheng-trip/tongcheng-trip.js new file mode 100644 index 000000000..9bd826d79 --- /dev/null +++ b/tongcheng-trip/tongcheng-trip.js @@ -0,0 +1,207 @@ +/** + * + * hostname = app.17u.cn + * + * # Surge + * http-request ^https:\/\/app\.17u\.cn\/welfarecenter\/index\/signIndex script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行 + * cron "5 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行-签到 + * + * # QuanX + * ^https:\/\/app\.17u\.cn\/welfarecenter\/index\/signIndex url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js + * 5 12 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行-签到 + * + * # Loon + * http-request ^https:\/\/app\.17u\.cn\/welfarecenter\/index\/signIndex script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行 + * cron "5 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行-签到 + * + * # 获取方式: 打开同程旅行 APP → 领福利 → 点击签到,命中 signIndex 请求后自动保存请求头(含 phone、apptoken、device) + */ + + +const $ = new Env('同程旅行') +const BASE_URL = 'https://app.17u.cn/welfarecenter' +const KEY_SIGNHEADER = 'tc_tongcheng_signheader' + +function getTodayDate() { + return $.time('yyyy-MM-dd') +} + +function postApi(path, body, headers) { + return new Promise((resolve) => { + const opts = { + url: path.startsWith('http') ? path : BASE_URL + path, + headers: { ...headers, 'content-type': 'application/json' }, + body: typeof body === 'object' ? JSON.stringify(body || {}) : body || '{}' + } + $.post(opts, (err, resp, data) => { + try { + resolve(data ? JSON.parse(data) : null) + } catch (e) { + $.logErr(e, data) + resolve(null) + } + }) + }) +} + +function signIndex() { + return new Promise((resolve) => { + const signheaderVal = $.getdata(KEY_SIGNHEADER) + if (!signheaderVal) { + $.log('未获取到 Cookie,请先通过 MiTM 获取:在 APP 打开「领福利」→ 点击签到') + $.msg($.name, '', '请先配置抓包脚本,在 APP 领福利页点击签到以获取 Cookie') + resolve(null) + return + } + $.headers = JSON.parse(signheaderVal) + $.phone = $.headers.phone || $.headers.Phone || '当前账号' + postApi('/index/signIndex', {}, $.headers).then((data) => resolve(data)) + }) +} + +function doSignIn() { + return new Promise((resolve) => { + const todayDate = getTodayDate() + postApi('/index/sign', { type: 1, day: todayDate }, $.headers).then((data) => resolve(data)) + }) +} + +function getTaskList() { + return new Promise((resolve) => { + postApi('/task/taskList?version=11.0.7', {}, $.headers).then((data) => resolve(data)) + }) +} + +function taskStart(taskCode) { + return new Promise((resolve) => { + postApi('/task/start', { taskCode }, $.headers).then((data) => resolve(data)) + }) +} + +function taskFinish(taskId) { + return new Promise((resolve) => { + postApi('/task/finish', { id: taskId }, $.headers).then((data) => resolve(data)) + }) +} + +function taskReceive(taskId) { + return new Promise((resolve) => { + postApi('/task/receive', { id: taskId }, $.headers).then((data) => resolve(data)) + }) +} + +async function runSignIn() { + $.accountResult = '' + $.signSuccess = false + $.tokenInvalid = false + + const signIndexRes = await signIndex() + if (!signIndexRes) return + if (signIndexRes.code !== 2200) { + $.log(`用户【${$.phone}】 - token 失效了,请重新在 APP 领福利页点击签到以更新`) + $.tokenInvalid = true + $.accountResult = `📱 账号:${$.phone}\n❌ token 失效,请重新抓包获取\n\n` + if (($.getdata('tc_push_switch') || $.getval('tc_push_switch') || '1') === '1' || $.tokenInvalid) { + $.msg('✈️ 同程旅行签到结果\n⚠️ Token 失效', '', $.accountResult) + } + return + } + + const todaySign = signIndexRes.data?.todaySign + const mileage = signIndexRes.data?.mileageBalance?.mileage ?? 0 + $.log(`用户【${$.phone}】 - 今日${todaySign ? '已' : '未'}签到,当前剩余里程 ${mileage}!`) + + if (todaySign) { + $.log(`用户【${$.phone}】 - 今日已签到,开始获取任务列表`) + $.signSuccess = true + } else { + $.log(`用户【${$.phone}】 - 今日未签到,开始执行签到`) + const signRes = await doSignIn() + if (signRes && signRes.code === 2200) { + $.log(`用户【${$.phone}】 - 签到成功!`) + $.signSuccess = true + } else { + $.log(`用户【${$.phone}】 - 签到失败!${signRes?.message || '未知错误'}`) + } + } + + const taskListRes = await getTaskList() + if (taskListRes && taskListRes.code === 2200 && Array.isArray(taskListRes.data)) { + const tasks = taskListRes.data.filter((t) => t.state === 1 && t.browserTime !== 0) + for (const task of tasks) { + const { taskCode, title, browserTime } = task + $.log(`用户【${$.phone}】 - 开始做任务【${title}】,需要浏览 ${browserTime} 秒`) + const startRes = await taskStart(taskCode) + if (startRes && startRes.code === 2200 && startRes.data) { + const taskId = startRes.data + await $.wait(browserTime * 1000) + let finishOk = false + for (let attempt = 0; attempt < 3; attempt++) { + const finishRes = await taskFinish(taskId) + if (finishRes && finishRes.code === 2200) { + $.log(`用户【${$.phone}】 - 完成任务【${taskId}】成功!开始领取奖励`) + finishOk = true + break + } + if (attempt < 2) { + $.log(`用户【${$.phone}】 - 完成任务【${taskId}】失败,第 ${attempt + 1} 次重试...`) + await $.wait(2000 * (attempt + 1)) + } + } + if (finishOk) { + await taskReceive(taskId) + $.log(`用户【${$.phone}】 - 领取签到奖励成功!开始下一个任务`) + } + } + } + } + + const mileageRes = await postApi('/index/signIndex', {}, $.headers) + if (mileageRes && mileageRes.code === 2200 && mileageRes.data) { + const d = mileageRes.data + const cycleSignNum = d.cycleSighNum + const mileage2 = d.mileageBalance?.mileage ?? 0 + const todayMileage = d.mileageBalance?.todayMileage ?? 0 + $.log(`用户【${$.phone}】 - 本月签到 ${cycleSignNum} 天,今日共获取 ${todayMileage} 里程,当前剩余里程 ${mileage2}`) + const statusIcon = $.signSuccess ? '✨️' : '❗️' + const resultText = $.signSuccess + ? `${statusIcon} 签到成功,本月签到【${cycleSignNum}】天` + : `${statusIcon} 签到暂不可用,请前往 APP 手动签到!\n🈷️ 本月签到【${cycleSignNum}】天` + $.accountResult = `📱 账号:${$.phone}\n${resultText}\n🎁 当前里程: 【${mileage2}】(+${todayMileage})\n\n` + } else { + $.accountResult = `📱 账号:${$.phone}\n` + if ($.signSuccess) $.accountResult += '✅ 签到成功(但获取里程信息失败)\n\n' + else $.accountResult += '❌ 签到失败且获取里程信息失败\n\n' + } + + const pushSwitch = ($.getdata('tc_push_switch') || $.getval('tc_push_switch') || '1').toString() + if (pushSwitch === '1' || $.tokenInvalid) { + let title = '✈️ 同程旅行签到结果\n' + if ($.tokenInvalid) title += ' ⚠️ Token 失效' + $.msg(title, '', $.accountResult.trim()) + } else { + $.log('✅ 推送已关闭,不发送推送通知') + } +} + +// 入口:MiTM 时保存 Cookie,否则执行签到 +const isMitm = + typeof $request !== 'undefined' && + $request && + $request.url && + $request.method !== 'OPTIONS' + +if (isMitm) { + $.setdata(JSON.stringify($request.headers), KEY_SIGNHEADER) + $.msg($.name, '获取同程旅行账户成功', '请运行签到脚本') + $.done() +} else { + !(async () => { + await runSignIn() + })() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} + + +function Env(e,t){class s{constructor(e){this.env=e}send(e,t="GET"){e="string"==typeof e?{url:e}:e;let s=this.get;"POST"===t&&(s=this.post);const i=new Promise(((t,i)=>{s.call(this,e,((e,s,o)=>{e?i(e):t(s)}))}));return e.timeout?((e,t=1e3)=>Promise.race([e,new Promise(((e,s)=>{setTimeout((()=>{s(new Error("请求超时"))}),t)}))]))(i,e.timeout):i}get(e){return this.send.call(this.env,e)}post(e){return this.send.call(this.env,e,"POST")}}return new class{constructor(e,t){this.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",this.name=e,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,t),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(e,t=null){try{return JSON.parse(e)}catch{return t}}toStr(e,t=null,...s){try{return JSON.stringify(e,...s)}catch{return t}}getjson(e,t){let s=t;if(this.getdata(e))try{s=JSON.parse(this.getdata(e))}catch{}return s}setjson(e,t){try{return this.setdata(JSON.stringify(e),t)}catch{return!1}}getScript(e){return new Promise((t=>{this.get({url:e},((e,s,i)=>t(i)))}))}runScript(e,t){return new Promise((s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=t&&t.timeout?t.timeout:o;const[r,a]=i.split("@"),n={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:e,mock_type:"cron",timeout:o},headers:{"X-Key":r,Accept:"*/*"},policy:"DIRECT",timeout:o};this.post(n,((e,t,i)=>s(i)))})).catch((e=>this.logErr(e)))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const e=this.path.resolve(this.dataFile),t=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(e),i=!s&&this.fs.existsSync(t);if(!s&&!i)return{};{const i=s?e:t;try{return JSON.parse(this.fs.readFileSync(i))}catch(e){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const e=this.path.resolve(this.dataFile),t=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(e),i=!s&&this.fs.existsSync(t),o=JSON.stringify(this.data);s?this.fs.writeFileSync(e,o):i?this.fs.writeFileSync(t,o):this.fs.writeFileSync(e,o)}}lodash_get(e,t,s){const i=t.replace(/\[(\d+)\]/g,".$1").split(".");let o=e;for(const e of i)if(o=Object(o)[e],void 0===o)return s;return o}lodash_set(e,t,s){return Object(e)!==e||(Array.isArray(t)||(t=t.toString().match(/[^.[\]]+/g)||[]),t.slice(0,-1).reduce(((e,s,i)=>Object(e[s])===e[s]?e[s]:e[s]=Math.abs(t[i+1])>>0==+t[i+1]?[]:{}),e)[t[t.length-1]]=s),e}getdata(e){let t=this.getval(e);if(/^@/.test(e)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(e),o=s?this.getval(s):"";if(o)try{const e=JSON.parse(o);t=e?this.lodash_get(e,i,""):t}catch(e){t=""}}return t}setdata(e,t){let s=!1;if(/^@/.test(t)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(t),r=this.getval(i),a=i?"null"===r?null:r||"{}":"{}";try{const t=JSON.parse(a);this.lodash_set(t,o,e),s=this.setval(JSON.stringify(t),i)}catch(t){const r={};this.lodash_set(r,o,e),s=this.setval(JSON.stringify(r),i)}}else s=this.setval(e,t);return s}getval(e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(e);case"Quantumult X":return $prefs.valueForKey(e);case"Node.js":return this.data=this.loaddata(),this.data[e];default:return this.data&&this.data[e]||null}}setval(e,t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(e,t);case"Quantumult X":return $prefs.setValueForKey(e,t);case"Node.js":return this.data=this.loaddata(),this.data[t]=e,this.writedata(),!0;default:return this.data&&this.data[t]||null}}initGotEnv(e){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,e&&(e.headers=e.headers?e.headers:{},e&&(e.headers=e.headers?e.headers:{},void 0===e.headers.cookie&&void 0===e.headers.Cookie&&void 0===e.cookieJar&&(e.cookieJar=this.ckjar)))}get(e,t=(()=>{})){switch(e.headers&&(delete e.headers["Content-Type"],delete e.headers["Content-Length"],delete e.headers["content-type"],delete e.headers["content-length"]),e.params&&(e.url+="?"+this.queryStr(e.params)),void 0===e.followRedirect||e.followRedirect||((this.isSurge()||this.isLoon())&&(e["auto-redirect"]=!1),this.isQuanX()&&(e.opts?e.opts.redirection=!1:e.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(e,((e,s,i)=>{!e&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),t(e,s,i)}));break;case"Quantumult X":this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((e=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=e;t(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(e=>t(e&&e.error||"UndefinedError")));break;case"Node.js":let s=require("iconv-lite");this.initGotEnv(e),this.got(e).on("redirect",((e,t)=>{try{if(e.headers["set-cookie"]){const s=e.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),t.cookieJar=this.ckjar}}catch(e){this.logErr(e)}})).then((e=>{const{statusCode:i,statusCode:o,headers:r,rawBody:a}=e,n=s.decode(a,this.encoding);t(null,{status:i,statusCode:o,headers:r,rawBody:a,body:n},n)}),(e=>{const{message:i,response:o}=e;t(i,o,o&&s.decode(o.rawBody,this.encoding))}));break}}post(e,t=(()=>{})){const s=e.method?e.method.toLocaleLowerCase():"post";switch(e.body&&e.headers&&!e.headers["Content-Type"]&&!e.headers["content-type"]&&(e.headers["content-type"]="application/x-www-form-urlencoded"),e.headers&&(delete e.headers["Content-Length"],delete e.headers["content-length"]),void 0===e.followRedirect||e.followRedirect||((this.isSurge()||this.isLoon())&&(e["auto-redirect"]=!1),this.isQuanX()&&(e.opts?e.opts.redirection=!1:e.opts={redirection:!1})),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](e,((e,s,i)=>{!e&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),t(e,s,i)}));break;case"Quantumult X":e.method=s,this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((e=>{const{statusCode:s,statusCode:i,headers:o,body:r,bodyBytes:a}=e;t(null,{status:s,statusCode:i,headers:o,body:r,bodyBytes:a},r,a)}),(e=>t(e&&e.error||"UndefinedError")));break;case"Node.js":let i=require("iconv-lite");this.initGotEnv(e);const{url:o,...r}=e;this.got[s](o,r).then((e=>{const{statusCode:s,statusCode:o,headers:r,rawBody:a}=e,n=i.decode(a,this.encoding);t(null,{status:s,statusCode:o,headers:r,rawBody:a,body:n},n)}),(e=>{const{message:s,response:o}=e;t(s,o,o&&i.decode(o.rawBody,this.encoding))}));break}}time(e,t=null){const s=t?new Date(t):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let t in i)new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?i[t]:("00"+i[t]).substr((""+i[t]).length)));return e}queryStr(e){let t="";for(const s in e){let i=e[s];null!=i&&""!==i&&("object"==typeof i&&(i=JSON.stringify(i)),t+=`${s}=${i}&`)}return t=t.substring(0,t.length-1),t}msg(t=e,s="",i="",o={}){const r=e=>{const{$open:t,$copy:s,$media:i,$mediaMime:o}=e;switch(typeof e){case void 0:return e;case"string":switch(this.getEnv()){case"Surge":case"Stash":default:return{url:e};case"Loon":case"Shadowrocket":return e;case"Quantumult X":return{"open-url":e};case"Node.js":return}case"object":switch(this.getEnv()){case"Surge":case"Stash":case"Shadowrocket":default:{const r={};let a=e.openUrl||e.url||e["open-url"]||t;a&&Object.assign(r,{action:"open-url",url:a});let n=e["update-pasteboard"]||e.updatePasteboard||s;n&&Object.assign(r,{action:"clipboard",text:n});let h=e.mediaUrl||e["media-url"]||i;if(h){let e,t;if(h.startsWith("http"));else if(h.startsWith("data:")){const[s]=h.split(";"),[,i]=h.split(",");e=i,t=s.replace("data:","")}else{e=h,t=(e=>{const t={JVBERi0:"application/pdf",R0lGODdh:"image/gif",R0lGODlh:"image/gif",iVBORw0KGgo:"image/png","/9j/":"image/jpg"};for(var s in t)if(0===e.indexOf(s))return t[s];return null})(h)}Object.assign(r,{"media-url":h,"media-base64":e,"media-base64-mime":o??t})}return Object.assign(r,{"auto-dismiss":e["auto-dismiss"],sound:e.sound}),r}case"Loon":{const s={};let o=e.openUrl||e.url||e["open-url"]||t;o&&Object.assign(s,{openUrl:o});let r=e.mediaUrl||e["media-url"]||i;return r&&Object.assign(s,{mediaUrl:r}),console.log(JSON.stringify(s)),s}case"Quantumult X":{const o={};let r=e["open-url"]||e.url||e.openUrl||t;r&&Object.assign(o,{"open-url":r});let a=e.mediaUrl||e["media-url"]||i;a&&Object.assign(o,{"media-url":a});let n=e["update-pasteboard"]||e.updatePasteboard||s;return n&&Object.assign(o,{"update-pasteboard":n}),console.log(JSON.stringify(o)),o}case"Node.js":return}default:return}};if(!this.isMute)switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:$notification.post(t,s,i,r(o));break;case"Quantumult X":$notify(t,s,i,r(o));break;case"Node.js":break}if(!this.isMuteLog){let e=["","==============📣系统通知📣=============="];e.push(t),s&&e.push(s),i&&e.push(i),console.log(e.join("\n")),this.logs=this.logs.concat(e)}}debug(...e){this.logLevels[this.logLevel]<=this.logLevels.debug&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.debug}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}info(...e){this.logLevels[this.logLevel]<=this.logLevels.info&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.info}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}warn(...e){this.logLevels[this.logLevel]<=this.logLevels.warn&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.warn}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}error(...e){this.logLevels[this.logLevel]<=this.logLevels.error&&(e.length>0&&(this.logs=[...this.logs,...e]),console.log(`${this.logLevelPrefixs.error}${e.map((e=>e??String(e))).join(this.logSeparator)}`))}log(...e){e.length>0&&(this.logs=[...this.logs,...e]),console.log(e.map((e=>e??String(e))).join(this.logSeparator))}logErr(e,t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:this.log("",`❗️${this.name}, 错误!`,t,e);break;case"Node.js":this.log("",`❗️${this.name}, 错误!`,t,void 0!==e.message?e.message:e,e.stack);break}}wait(e){return new Promise((t=>setTimeout(t,e)))}done(e={}){const t=((new Date).getTime()-this.startTime)/1e3;switch(this.log("",`🔔${this.name}, 结束! 🕛 ${t} 秒`),this.log(),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:$done(e);break;case"Node.js":process.exit(1)}}}(e,t)} \ No newline at end of file From c5c5615fe871eb7d6c3f66fba53df48a4e52a30a Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Fri, 13 Feb 2026 16:56:47 +0800 Subject: [PATCH 345/348] fix: logic --- tongcheng-trip/tongcheng-trip.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tongcheng-trip/tongcheng-trip.js b/tongcheng-trip/tongcheng-trip.js index 9bd826d79..a9091a1fb 100644 --- a/tongcheng-trip/tongcheng-trip.js +++ b/tongcheng-trip/tongcheng-trip.js @@ -185,16 +185,15 @@ async function runSignIn() { } // 入口:MiTM 时保存 Cookie,否则执行签到 -const isMitm = - typeof $request !== 'undefined' && - $request && - $request.url && - $request.method !== 'OPTIONS' - -if (isMitm) { - $.setdata(JSON.stringify($request.headers), KEY_SIGNHEADER) - $.msg($.name, '获取同程旅行账户成功', '请运行签到脚本') - $.done() +if (typeof $request !== 'undefined') { + if ($request.method !== 'OPTIONS') { + $.setdata(JSON.stringify($request.headers), KEY_SIGNHEADER) + $.msg($.name, '获取同程旅行账户成功', '请运行签到脚本') + $.done() + } else { + $.log('获取同程旅行账户失败') + $.done() + } } else { !(async () => { await runSignIn() From d770b20d4b75897089713bea2f470155f80e38f6 Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Fri, 13 Feb 2026 17:27:07 +0800 Subject: [PATCH 346/348] fix: timeout --- tongcheng-trip/tongcheng-trip.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tongcheng-trip/tongcheng-trip.js b/tongcheng-trip/tongcheng-trip.js index a9091a1fb..705d48245 100644 --- a/tongcheng-trip/tongcheng-trip.js +++ b/tongcheng-trip/tongcheng-trip.js @@ -4,7 +4,7 @@ * * # Surge * http-request ^https:\/\/app\.17u\.cn\/welfarecenter\/index\/signIndex script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行 - * cron "5 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行-签到 + * cron "5 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, timeout=300, tag=同程旅行-签到 * * # QuanX * ^https:\/\/app\.17u\.cn\/welfarecenter\/index\/signIndex url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js @@ -12,15 +12,15 @@ * * # Loon * http-request ^https:\/\/app\.17u\.cn\/welfarecenter\/index\/signIndex script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行 - * cron "5 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, tag=同程旅行-签到 + * cron "5 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tongcheng-trip/tongcheng-trip.js, timeout=300, tag=同程旅行-签到 * - * # 获取方式: 打开同程旅行 APP → 领福利 → 点击签到,命中 signIndex 请求后自动保存请求头(含 phone、apptoken、device) + * # 获取方式: 打开同程旅行 APP → 领福利,命中 signIndex 请求后自动保存请求头(含 phone、apptoken、device) */ const $ = new Env('同程旅行') const BASE_URL = 'https://app.17u.cn/welfarecenter' -const KEY_SIGNHEADER = 'tc_tongcheng_signheader' +const KEY_SIGNHEADER = 'tongcheng_trip_signheader' function getTodayDate() { return $.time('yyyy-MM-dd') From c0c5e629cf90253928a3e83bd12f426e2dbe26d7 Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Tue, 24 Feb 2026 11:15:20 +0800 Subject: [PATCH 347/348] =?UTF-8?q?chore:=20=E5=BD=92=E6=A1=A3=20zimuzu?= =?UTF-8?q?=E3=80=81rrtv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- Loon.cookie.conf | 6 +++--- Loon.task.conf | 4 ++-- QuantumultX_AppStore_Local_Cookie.conf | 6 +++--- QuantumultX_Local_Cookie.conf | 6 +++--- QuantumultX_Local_Task.conf | 4 ++-- QuantumultX_Remote_Task.conf | 4 ++-- {rrtv => achived/rrtv}/README.md | 4 +++- {rrtv => achived/rrtv}/rrtv.cookie.js | 0 {rrtv => achived/rrtv}/rrtv.js | 0 {zimuzu => achived/zimuzu}/README.md | 4 +++- {zimuzu => achived/zimuzu}/zimuzu.cookie.js | 0 {zimuzu => achived/zimuzu}/zimuzu.js | 0 box/chavy.boxjs.json | 6 +++--- surge.cookies.sgmodule | 3 --- surge.tasks.sgmodule | 2 -- 15 files changed, 24 insertions(+), 25 deletions(-) rename {rrtv => achived/rrtv}/README.md (96%) rename {rrtv => achived/rrtv}/rrtv.cookie.js (100%) rename {rrtv => achived/rrtv}/rrtv.js (100%) rename {zimuzu => achived/zimuzu}/README.md (96%) rename {zimuzu => achived/zimuzu}/zimuzu.cookie.js (100%) rename {zimuzu => achived/zimuzu}/zimuzu.js (100%) diff --git a/Loon.cookie.conf b/Loon.cookie.conf index 08bfb316c..89181cf35 100644 --- a/Loon.cookie.conf +++ b/Loon.cookie.conf @@ -7,10 +7,10 @@ http-request ^https:\/\/(www|live)\.bilibili\.com\/?.? script-path=https://raw.g http-request ^https:\/\/(www\.)?feng\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js, tag=威锋论坛 http-request ^https:\/\/access.video.qq.com\/user\/auth_refresh script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/videoqq/videoqq.cookie.js, tag=腾讯视频 http-request ^https:\/\/api\-new\.app\.acfun\.cn\/rest\/app\/user\/personalInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/acfun/acfun.cookie.js, tag=AcFun -http-request ^https?:\/\/(www\.)?rrys2020\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js, tag=字幕组 -http-request ^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js, tag=字幕组 +# http-request ^https?:\/\/(www\.)?rrys2020\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/achived/zimuzu/zimuzu.cookie.js, tag=字幕组 [archived] +# http-request ^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/achived/zimuzu/zimuzu.cookie.js, tag=字幕组 [archived] http-request ^https?:\/\/.*\/mobile\-user\/(v1\/)?homePage\/.* script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js,tag=喜马拉雅 -http-request ^https:\/\/api\.rr\.tv\/user\/profile script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.cookie.js, tag=人人视频 +# http-request ^https:\/\/api\.rr\.tv\/user\/profile script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/achived/rrtv/rrtv.cookie.js, tag=人人视频 [archived] http-request ^https:\/\/www\.flyertea\.com\/source\/plugin\/mobile\/mobile\.php\?module=getdata&.* script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/flyertea/flyertea.cookie.js, tag=飞客茶馆 http-request ^https:\/\/sf-integral-sign-in.weixinjia.net\/app\/index script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.cookie.js, tag=顺丰速运 http-request ^https:\/\/mcs-mimp-web.sf-express.com\/mcs-mimp\/share\/(.*?)Redirect script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.cookie.js, tag=顺丰速运 diff --git a/Loon.task.conf b/Loon.task.conf index de151565a..07ccf6470 100644 --- a/Loon.task.conf +++ b/Loon.task.conf @@ -12,14 +12,14 @@ cron "0 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scri cron "10 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js,tag=网易云音乐 cron "30 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasenews/neteasenews.js,tag=网易新闻 cron "40 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.js,tag=去哪儿 -cron "50 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.js,tag=人人视频 +# cron "50 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/achived/rrtv/rrtv.js,tag=人人视频 [archived] cron "0 3 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.js,tag= 顺丰速运 cron "10 3 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/smzdm.js,tag=什么值得买 cron "20 3 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/v2ex.js,tag=V2EX cron "30 3 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/videoqq/videoqq.js,tag=腾讯视频 cron "40 3 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.js,tag=喜马拉雅 cron "50 3 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/yanxuan/yanxuan.js,tag=网易严选 -cron "0 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.js,tag=字幕组 +# cron "0 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/achived/zimuzu/zimuzu.js,tag=字幕组 [archived] cron "10 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qqmusic/qqmusic.js,tag=QQ音乐 cron "20 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/csdn/csdn.js,tag=CSDN cron "30 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.js,tag=加油广东 diff --git a/QuantumultX_AppStore_Local_Cookie.conf b/QuantumultX_AppStore_Local_Cookie.conf index 534b2472b..dd05f7183 100644 --- a/QuantumultX_AppStore_Local_Cookie.conf +++ b/QuantumultX_AppStore_Local_Cookie.conf @@ -38,7 +38,7 @@ hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning ^https:\/\/user.qunar.com\/webapi\/member\/signIndexV2.htm url script-request-header chavyleung/qunar/qunar.cookie.js # 人人视频 -^https:\/\/api\.rr\.tv\/user\/profile url script-request-header chavyleung/rrtv/rrtv.cookie.js +# ^https:\/\/api\.rr\.tv\/user\/profile url script-request-header chavyleung/achived/rrtv/rrtv.cookie.js [archived] # 顺丰速运 ^https:\/\/sf-integral-sign-in.weixinjia.net\/app\/index url script-request-header chavyleung/sfexpress/sfexpress.cookie.js @@ -63,8 +63,8 @@ hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning # ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json url script-request-header chavyleung/yanxuan/yanxuan.cookie.js # 字幕组 -^https?:\/\/(www\.)?rrys2020\.com\/?.? url script-request-header chavyleung/zimuzu/zimuzu.cookie.js -^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login url script-request-header chavyleung/zimuzu/zimuzu.cookie.js +# ^https?:\/\/(www\.)?rrys2020\.com\/?.? url script-request-header chavyleung/achived/zimuzu/zimuzu.cookie.js [archived] +# ^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login url script-request-header chavyleung/achived/zimuzu/zimuzu.cookie.js [archived] # 加油广东 ^https:\/\/gdws.nsenz.com\/webapi\/usersign\/addusersign url script-request-header chavyleung/gdoil/gdoil.cookie.js diff --git a/QuantumultX_Local_Cookie.conf b/QuantumultX_Local_Cookie.conf index befe447bd..af36a0ede 100644 --- a/QuantumultX_Local_Cookie.conf +++ b/QuantumultX_Local_Cookie.conf @@ -38,7 +38,7 @@ hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning ^https:\/\/user.qunar.com\/webapi\/member\/signIndexV2.htm url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.cookie.js # 人人视频 -^https:\/\/api\.rr\.tv\/user\/profile url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.cookie.js +# ^https:\/\/api\.rr\.tv\/user\/profile url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/achived/rrtv/rrtv.cookie.js [archived] # 顺丰速运 ^https:\/\/sf-integral-sign-in.weixinjia.net\/app\/index url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.cookie.js @@ -63,8 +63,8 @@ hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning # ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/yanxuan/yanxuan.cookie.js # 字幕组 -^https?:\/\/(www\.)?rrys2020\.com\/?.? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js -^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js +# ^https?:\/\/(www\.)?rrys2020\.com\/?.? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/achived/zimuzu/zimuzu.cookie.js [archived] +# ^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/achived/zimuzu/zimuzu.cookie.js [archived] # 加油广东 ^https:\/\/m.gdoil.cn\/webapi\/usersign\/addusersign url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.cookie.js diff --git a/QuantumultX_Local_Task.conf b/QuantumultX_Local_Task.conf index ceb023f13..c0f5087b7 100644 --- a/QuantumultX_Local_Task.conf +++ b/QuantumultX_Local_Task.conf @@ -26,7 +26,7 @@ # 去哪儿 4 0 * * * chavyleung/qunar/qunar.js # 人人视频 -10 0 * * * chavyleung/rrtv/rrtv.js +# 10 0 * * * chavyleung/achived/rrtv/rrtv.js [archived] # 顺丰速运 10 0 * * * chavyleung/sfexpress/sfexpress.js # 什么值得买 @@ -42,7 +42,7 @@ # 网易严选 # 4 0 * * * chavyleung/yanxuan/yanxuan.js # 字幕组 -3 0 * * * chavyleung/zimuzu/zimuzu.js +# 3 0 * * * chavyleung/achived/zimuzu/zimuzu.js [archived] # CSDN 4 0 * * * chavyleung/csdn/csdn.js # 加油广东 diff --git a/QuantumultX_Remote_Task.conf b/QuantumultX_Remote_Task.conf index 20e326307..5a11b7249 100644 --- a/QuantumultX_Remote_Task.conf +++ b/QuantumultX_Remote_Task.conf @@ -44,7 +44,7 @@ # 人人视频 #打开 APP, 访问下`个人中心` -4 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.js +# 4 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/achived/rrtv/rrtv.js [archived] # 顺丰速运 #打开 APP, 访问下`我的顺丰` > `去签到` (访问下`去签到`的页面即可, 不用点`签到`) @@ -76,7 +76,7 @@ # 字幕组 #网页:打开浏览器访问: http://www.rrys2020.com, App: 打开 APP 即可 -7 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.js +# 7 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/achived/zimuzu/zimuzu.js [archived] # QQ音乐 #打开 APP 然后手动签到 1 次 diff --git a/rrtv/README.md b/achived/rrtv/README.md similarity index 96% rename from rrtv/README.md rename to achived/rrtv/README.md index c8d423948..571b03ce2 100644 --- a/rrtv/README.md +++ b/achived/rrtv/README.md @@ -1,4 +1,6 @@ -# 人人视频 +# 人人视频 [已归档] + +> **归档说明**:脚本已归档,仅作存档。若需使用请将配置中的路径改为 `achived/rrtv/`。 > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 diff --git a/rrtv/rrtv.cookie.js b/achived/rrtv/rrtv.cookie.js similarity index 100% rename from rrtv/rrtv.cookie.js rename to achived/rrtv/rrtv.cookie.js diff --git a/rrtv/rrtv.js b/achived/rrtv/rrtv.js similarity index 100% rename from rrtv/rrtv.js rename to achived/rrtv/rrtv.js diff --git a/zimuzu/README.md b/achived/zimuzu/README.md similarity index 96% rename from zimuzu/README.md rename to achived/zimuzu/README.md index 824671dc5..2f51e5cd8 100644 --- a/zimuzu/README.md +++ b/achived/zimuzu/README.md @@ -1,4 +1,6 @@ -# 字幕组 +# 字幕组 [已归档] + +> **归档说明**:脚本已失效,仅作存档。若需使用请将配置中的路径改为 `achived/zimuzu/`。 ## 配置 (Surge) diff --git a/zimuzu/zimuzu.cookie.js b/achived/zimuzu/zimuzu.cookie.js similarity index 100% rename from zimuzu/zimuzu.cookie.js rename to achived/zimuzu/zimuzu.cookie.js diff --git a/zimuzu/zimuzu.js b/achived/zimuzu/zimuzu.js similarity index 100% rename from zimuzu/zimuzu.js rename to achived/zimuzu/zimuzu.js diff --git a/box/chavy.boxjs.json b/box/chavy.boxjs.json index a2e2a1e87..4a6cdf634 100644 --- a/box/chavy.boxjs.json +++ b/box/chavy.boxjs.json @@ -638,15 +638,15 @@ }, { "id": "rrtv", - "name": "人人视频", + "name": "人人视频 [archived]", "keys": ["chavy_cookie_rrtv"], "author": "@chavyleung", - "repo": "https://github.com/chavyleung/scripts/tree/master/rrtv", + "repo": "https://github.com/chavyleung/scripts/tree/master/achived/rrtv", "icons": [ "https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/rrtv.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/rrtv.png" ], - "script": "https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.js" + "script": "https://raw.githubusercontent.com/chavyleung/scripts/master/achived/rrtv/rrtv.js" }, { "id": "everphoto", diff --git a/surge.cookies.sgmodule b/surge.cookies.sgmodule index 836f08279..abdc5f3e7 100644 --- a/surge.cookies.sgmodule +++ b/surge.cookies.sgmodule @@ -31,7 +31,6 @@ Rewrite: 美团外卖 = type=http-request,pattern=^https:\/\/promotion.waimai.me Rewrite: 芒果TV = type=http-request,pattern=^https:\/\/credits.bz.mgtv.com\/user\/creditsTake,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.cookie.js Rewrite: 全民K歌 = type=http-request,pattern=^https://node\.kg\.qq\.com/webapp/proxy?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.cookie.js,requires-body=true Rewrite: 去哪儿 = type=http-request,pattern=^https:\/\/user.qunar.com\/webapi\/member\/signIndexV2.htm,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.cookie.js -Rewrite: 人人视频 = type=http-request,pattern=^https:\/\/api\.rr\.tv\/user\/profile,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.cookie.js Rewrite: 什么值得买 = type=http-request,pattern=^https:\/\/www\.smzdm\.com\/?.?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/smzdm.cookie.js Rewrite: 时光相册 = type=http-request,pattern=^https:\/\/api.everphoto.cn\/users\/self\/checkin\/v2,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/everphoto/everphoto.cookie.js Rewrite: 苏宁易购 = type=http-request,pattern=^https:\/\/gameapi.suning.com\/sngame-web\/(api\/signin\/private\/customerSignOperation.do|gateway\/api\/queryPrize.do),script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js @@ -45,8 +44,6 @@ Rewrite: 网易新闻 = type=http-request,pattern=^https:\/\/(.*?)c\.m\.163\.com Rewrite: 网易考拉 = type=http-request,pattern=^https:\/\/m-bean\.kaola\.com/m/point/sign\.html,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wykl/wykl.cookie.js,requires-body=true Rewrite: 蔚来 = type=http-request,pattern=^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.cookie.js Rewrite: 喜马拉雅 = type=http-request,pattern=^https?:\/\/.*\/mobile\-user\/(v1\/)?homePage\/.*,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js -Rewrite: 字幕组 = type=http-request,pattern=^http:\/\/ios.zmzapi.com\/index.php.*a=(mobile_)?login,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js -Rewrite: 字幕组 = type=http-request,pattern=^https?:\/\/(www\.)?rrys2020\.com\/?.?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.cookie.js Rewrite: 智行火车 = type=http-request,pattern=^https:\/\/m\.suanya\.cn/restapi/soa2/\d+/attendanceDay,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js,requires-body=true Rewrite: citybox = type=http-request,pattern=^https:\/\/api\.icitybox\.cn\/index.php\/api\/user\/get_user_info,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.cookie.js,debug=true diff --git a/surge.tasks.sgmodule b/surge.tasks.sgmodule index 2b7ce5d75..08a647d45 100644 --- a/surge.tasks.sgmodule +++ b/surge.tasks.sgmodule @@ -14,7 +14,6 @@ Tasks: V2EX = type=cron,cronexp=2 9 * * *,script-path=https://raw.githubusercont Tasks: WPS = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js,wake-system=true Tasks: 叮咚买菜 = type=cron,cronexp=7 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.js,wake-system=true Tasks: 加油广东 = type=cron,cronexp=1 7 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.js,wake-system=true -Tasks: 人人视频 = type=cron,cronexp=10 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.js,wake-system=true Tasks: 什么值得买 = type=cron,cronexp=2 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/smzdm.js,wake-system=true Tasks: 喜马拉雅 = type=cron,cronexp=4 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.js,wake-system=true Tasks: 百度贴吧 = type=cron,cronexp=1 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js,wake-system=true @@ -27,7 +26,6 @@ Tasks: 时光相册 = type=cron,cronexp=7 0 * * *,script-path=https://raw.github Tasks: 苏宁易购 = type=cron,cronexp=7 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.js,wake-system=true Tasks: 顺丰速运 = type=cron,cronexp=6 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.js,wake-system=true Tasks: 网易云音乐 = type=cron,cronexp=1 7 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js,wake-system=true -Tasks: 字幕组 = type=cron,cronexp=3 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.js,wake-system=true Tasks: citybox-签到 = type=cron,cronexp=10 10 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/citybox/citybox.js,wake-system=true Tasks: 智行火车 = type=cron,cronexp=10 8 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.js,wake-system=true # Tasks: 美团外卖 = type=cron,cronexp=8 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.js From 477728ae254def750f8b58c6363b4359131e0b03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:17:22 +0800 Subject: [PATCH 348/348] chore(deps): bump qs from 6.14.1 to 6.14.2 (#517) Bumps [qs](https://github.com/ljharb/qs) from 6.14.1 to 6.14.2. - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.14.1...v6.14.2) --- updated-dependencies: - dependency-name: qs dependency-version: 6.14.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- yarn.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 51247838b..9c6188805 100644 --- a/package-lock.json +++ b/package-lock.json @@ -761,9 +761,9 @@ } }, "node_modules/qs": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", - "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.1.0" diff --git a/yarn.lock b/yarn.lock index 622645c65..2fbdcb733 100644 --- a/yarn.lock +++ b/yarn.lock @@ -456,9 +456,9 @@ punycode@^2.1.1: integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== qs@^6.4.0: - version "6.14.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.1.tgz#a41d85b9d3902f31d27861790506294881871159" - integrity sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ== + version "6.14.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.2.tgz#b5634cf9d9ad9898e31fba3504e866e8efb6798c" + integrity sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q== dependencies: side-channel "^1.1.0"