From 0183e33a7ef738449730af46bc4d761a5b0eb5b9 Mon Sep 17 00:00:00 2001 From: morooi <19279567+morooi@users.noreply.github.com> Date: Tue, 15 Jun 2021 11:42:19 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0[=E4=B8=87=E8=BE=BE?= =?UTF-8?q?=E7=94=B5=E5=BD=B1]:=202021=20=E5=B9=B4=206=20=E6=9C=88=20signc?= =?UTF-8?q?ode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wanda/wanda.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wanda/wanda.js b/wanda/wanda.js index 9c68334c9344..650fc18f7433 100644 --- a/wanda/wanda.js +++ b/wanda/wanda.js @@ -1,7 +1,7 @@ const $ = new Env('万达电影') $._mi_ = 'senku_wanda_mi_' $.desc = [] -$.signCode = '976120956' +$.signCode = '69212382' $.questionCode = '15884027' const date = tTime(new Date().getTime()) From 9be8c2d6de439fb103416f99be5987a28ca0f4f9 Mon Sep 17 00:00:00 2001 From: morooi <19279567+morooi@users.noreply.github.com> Date: Fri, 18 Jun 2021 00:51:32 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D[=E4=B8=87=E8=BE=BE?= =?UTF-8?q?=E7=94=B5=E5=BD=B1]:=202021=20=E5=B9=B4=206=20=E6=9C=88=20signc?= =?UTF-8?q?ode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wanda/wanda.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wanda/wanda.js b/wanda/wanda.js index 650fc18f7433..afec65025d8a 100644 --- a/wanda/wanda.js +++ b/wanda/wanda.js @@ -1,7 +1,7 @@ const $ = new Env('万达电影') $._mi_ = 'senku_wanda_mi_' $.desc = [] -$.signCode = '69212382' +$.signCode = '692123824' $.questionCode = '15884027' const date = tTime(new Date().getTime()) From 646e9c4104236b3fe1b1ac5233c45680d8151111 Mon Sep 17 00:00:00 2001 From: morooi <19279567+morooi@users.noreply.github.com> Date: Sat, 3 Jul 2021 10:49:07 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0[=E4=B8=87=E8=BE=BE?= =?UTF-8?q?=E7=94=B5=E5=BD=B1]:=202021=20=E5=B9=B4=207=20=E6=9C=88=20signc?= =?UTF-8?q?ode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wanda/wanda.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wanda/wanda.js b/wanda/wanda.js index afec65025d8a..c3e67eb79895 100644 --- a/wanda/wanda.js +++ b/wanda/wanda.js @@ -1,7 +1,7 @@ const $ = new Env('万达电影') $._mi_ = 'senku_wanda_mi_' $.desc = [] -$.signCode = '692123824' +$.signCode = '827125666' $.questionCode = '15884027' const date = tTime(new Date().getTime()) From d934e01ff43d808260135ff538271286562e8038 Mon Sep 17 00:00:00 2001 From: Chavy Date: Wed, 7 Jul 2021 15:07:09 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0[BoxJs]:=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8A=B9=E6=8E=89=20http=5Fbackend=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- box/scripts/boxjs.revert.usercfgs.httpbackend.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 box/scripts/boxjs.revert.usercfgs.httpbackend.js diff --git a/box/scripts/boxjs.revert.usercfgs.httpbackend.js b/box/scripts/boxjs.revert.usercfgs.httpbackend.js new file mode 100644 index 000000000000..7f4692b81732 --- /dev/null +++ b/box/scripts/boxjs.revert.usercfgs.httpbackend.js @@ -0,0 +1,15 @@ +const $ = new Env('BoxJs - 抹掉 HTTP-Backend') + +$.KEY_usercfgs = 'chavy_boxjs_userCfgs' + +const usercfgs = $.getjson($.KEY_usercfgs, {}) +usercfgs.http_backend = '' + +$.setjson(usercfgs, $.KEY_usercfgs) +$.done() + +/** + * EnvJs + */ +// 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}isShadowrocket(){return"undefined"!=typeof $rocket}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=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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: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:i,...r}=t;this.got[s](i,r).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,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}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)} From f8b7dbc046f65b7390fb78cd41ee2724a7fe386b Mon Sep 17 00:00:00 2001 From: NobyDa <53217160+NobyDa@users.noreply.github.com> Date: Wed, 14 Jul 2021 17:46:27 +0800 Subject: [PATCH 05/19] Boxjs: Bug fixes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果eval里运行的脚本声明了名为$的全局变量,且该变量非块级作用域类型,则会导致原$被污染,进而导致$.cached_logs.push异常. --- box/chavy.boxjs.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/box/chavy.boxjs.js b/box/chavy.boxjs.js index bff5cab9b56e..38237c22dc16 100644 --- a/box/chavy.boxjs.js +++ b/box/chavy.boxjs.js @@ -616,12 +616,12 @@ async function apiRunScript() { // 所以需要 `$request = undefined` $eval_env.request = $request $request = undefined - // 重写 console.log, 把日志记录到 $.cached_logs - $.cached_logs = [] + // 重写 console.log, 把日志记录到 $eval_env.cached_logs + $eval_env.cached_logs = [] console.cloned_log = console.log console.log = (l) => { console.cloned_log(l) - $.cached_logs.push(l) + $eval_env.cached_logs.push(l) } // 重写脚本内的 $done, 调用 $done() 即是调用 $eval_env.resolve() script_text = script_text.replace(/\$done/g, '$eval_env.resolve') @@ -629,7 +629,7 @@ async function apiRunScript() { try { eval(script_text) } catch (e) { - $.cached_logs.push(e) + $eval_env.cached_logs.push(e) resolve() } }) @@ -640,7 +640,7 @@ async function apiRunScript() { // 返回数据 $.json = { result: '', - output: $.cached_logs.join('\n') + output: $eval_env.cached_logs.join('\n') } } } From f191a1b2e10e218f15d01b3c06044834a8d2feac Mon Sep 17 00:00:00 2001 From: Chavy Date: Wed, 14 Jul 2021 18:09:53 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D(BoxJs):=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=83=85=E5=86=B5=E6=89=8B=E5=8A=A8=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- box/chavy.boxjs.js | 2 +- box/release/box.release.json | 16 ++++++++++++++++ box/release/box.release.tf.json | 16 ++++++++++++++++ chavy.box.js | 12 ++++++------ 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/box/chavy.boxjs.js b/box/chavy.boxjs.js index 38237c22dc16..230b48b0bde7 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.90' +$.version = '0.7.91' $.versionType = 'beta' // 发出的请求需要需要 Surge、QuanX 的 rewrite diff --git a/box/release/box.release.json b/box/release/box.release.json index 3add8a65771c..76a48b81e0a0 100644 --- a/box/release/box.release.json +++ b/box/release/box.release.json @@ -1,5 +1,21 @@ { "releases": [ + { + "version": "0.7.91", + "tags": ["beta"], + "author": "@NobyDa", + "msg": "修复(BoxJs): 部分情况手动运行脚本异常", + "notes": [ + { + "name": "修复", + "descs": ["部分情况手动运行脚本异常"] + }, + { + "name": "感谢", + "descs": ["@NobyDa PR"] + } + ] + }, { "version": "0.7.90", "tags": ["beta"], diff --git a/box/release/box.release.tf.json b/box/release/box.release.tf.json index 6464bfc3b1f5..12ab99343a96 100644 --- a/box/release/box.release.tf.json +++ b/box/release/box.release.tf.json @@ -1,5 +1,21 @@ { "releases": [ + { + "version": "0.7.91", + "tags": ["beta"], + "author": "@NobyDa", + "msg": "修复(BoxJs): 部分情况手动运行脚本异常", + "notes": [ + { + "name": "修复", + "descs": ["部分情况手动运行脚本异常"] + }, + { + "name": "感谢", + "descs": ["@NobyDa PR"] + } + ] + }, { "version": "0.7.90", "tags": ["beta"], diff --git a/chavy.box.js b/chavy.box.js index bff5cab9b56e..230b48b0bde7 100644 --- a/chavy.box.js +++ b/chavy.box.js @@ -3,7 +3,7 @@ const $ = new Env('BoxJs') // 为 eval 准备的上下文环境 const $eval_env = {} -$.version = '0.7.90' +$.version = '0.7.91' $.versionType = 'beta' // 发出的请求需要需要 Surge、QuanX 的 rewrite @@ -616,12 +616,12 @@ async function apiRunScript() { // 所以需要 `$request = undefined` $eval_env.request = $request $request = undefined - // 重写 console.log, 把日志记录到 $.cached_logs - $.cached_logs = [] + // 重写 console.log, 把日志记录到 $eval_env.cached_logs + $eval_env.cached_logs = [] console.cloned_log = console.log console.log = (l) => { console.cloned_log(l) - $.cached_logs.push(l) + $eval_env.cached_logs.push(l) } // 重写脚本内的 $done, 调用 $done() 即是调用 $eval_env.resolve() script_text = script_text.replace(/\$done/g, '$eval_env.resolve') @@ -629,7 +629,7 @@ async function apiRunScript() { try { eval(script_text) } catch (e) { - $.cached_logs.push(e) + $eval_env.cached_logs.push(e) resolve() } }) @@ -640,7 +640,7 @@ async function apiRunScript() { // 返回数据 $.json = { result: '', - output: $.cached_logs.join('\n') + output: $eval_env.cached_logs.join('\n') } } } From ef3390c6cacdd64793d84ce7a9e0af74b83f457c Mon Sep 17 00:00:00 2001 From: GideonSenku Date: Sun, 25 Jul 2021 01:05:32 +0800 Subject: [PATCH 07/19] feat: remove unused scripts --- Loon.cookie.conf | 141 ++-- Loon.task.conf | 119 ++-- QuantumultX_AppStore_Local_Cookie.conf | 8 - QuantumultX_Local_Cookie.conf | 8 - QuantumultX_Local_Task.conf | 7 +- QuantumultX_Remote_Task.conf | 12 - box/chavy.boxjs.json | 12 - midu/README.md | 117 ---- midu/midu.cookie.js | 171 ----- midu/miduRead.js | 372 ---------- midu/miduRead.py | 174 ----- midu/miduSign.js | 453 ------------- midu/miduSign.py | 479 ------------- qtt/.DS_Store | Bin 6148 -> 0 bytes qtt/README.md | 129 ---- qtt/qtt.cookie.js | 93 --- qtt/qtt.js | 893 ------------------------- surge.cookies.sgmodule | 4 - 18 files changed, 128 insertions(+), 3064 deletions(-) delete mode 100644 midu/README.md delete mode 100644 midu/midu.cookie.js delete mode 100644 midu/miduRead.js delete mode 100644 midu/miduRead.py delete mode 100644 midu/miduSign.js delete mode 100644 midu/miduSign.py delete mode 100644 qtt/.DS_Store delete mode 100644 qtt/README.md delete mode 100644 qtt/qtt.cookie.js delete mode 100644 qtt/qtt.js diff --git a/Loon.cookie.conf b/Loon.cookie.conf index 3f84eed0d139..42404c182528 100644 --- a/Loon.cookie.conf +++ b/Loon.cookie.conf @@ -1,72 +1,69 @@ -# Chavyleung -http-request ^https?:\/\/tieba\.baidu\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js, tag=百度签到(网页) -http-request ^https:\/\/music.163.com\/weapi\/user\/level script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js, requires-body=true, tag=网易云音乐 -http-request ^https:\/\/www\.smzdm\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/smzdm.cookie.js, tag=什么值得买 -http-request ^https:\/\/www\.v2ex\.com\/mission\/daily script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/v2ex.cookie.js, tag=V2ex -http-request ^https:\/\/(www|live)\.bilibili\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.cookie.js, tag=哔哩哔哩 -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?:\/\/.*\/mobile\-user\/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:\/\/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=顺丰速运 -http-request ^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js, requires-body=true, tag=中国电信 -http-request ^https:\/\/api\.dongqiudi\.com\/v2\/user\/is_login script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dongqiudi/dongqiudi.cookie.js, tag=懂球帝 -http-request ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/yanxuan/yanxuan.cookie.js, tag=网易严选 -http-request ^https:\/\/apk\.tw\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/apktw/apktw.cookie.js, tag=APK.TW -http-request ^https:\/\/user.qunar.com\/webapi\/member\/signIndexV2.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.cookie.js, tag=去哪儿 -http-request ^https:\/\/passport.csdn.net\/v2\/api\/app\/login\/checkAndRefreshToken script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/csdn/csdn.cookie.js, tag=CSDN -http-request ^https:\/\/gw.csdn.net\/mini-app\/v2\/lucky_draw\/login\/sign_in\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/csdn/csdn.cookie.js, tag=CSDN -http-request ^https:\/\/credits.bz.mgtv.com\/user\/creditsTake script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.cookie.js, tag=芒果tv -http-request ^https:\/\/m.gdoil.cn\/webapi\/usersign\/addusersign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.cookie.js, tag=加油广东 -http-request https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/maomicd/maomicd.cookie.js, tag=猫咪音乐 -http-request ^http:\/\/wx.10086.cn\/website\/taskCenter\/index\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.cookie.js, requires-body=true, tag=10086 -http-request ^http:\/\/wx.10086.cn\/website\/taskCenter\/sign\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.cookie.js, requires-body=true, tag=10086 -http-request ^https?:\/\/act.10010.com\/SigninApp\/signin\/querySigninActivity.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js, tag=中国联通 -http-request ^https?:\/\/act.10010.com\/SigninApp(.*?)\/signin\/daySign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js, tag=中国联通 -http-request ^https?:\/\/m.client.10010.com\/dailylottery\/static\/(textdl\/userLogin|active\/findActivityInfo) script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js, tag=中国联通 -http-request ^https:\/\/promotion.waimai.meituan.com\/playcenter\/signIn\/entry script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js, tag=美团外卖 -http-request ^https:\/\/promotion.waimai.meituan.com\/playcenter\/signIn\/doaction script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js, requires-body=true, tag=美团外卖 -http-request ^https:\/\/(.*?)c\.m\.163\.com\/uc\/api\/sign\/v3\/commit script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasenews/neteasenews.cookie.js, requires-body=true, tag=网易新闻 -http-request ^https:\/\/i.meituan.com\/evolve\/signin\/signpost\/ script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.cookie.js, requires-body=true, tag=美团 -http-request ^https:\/\/api.everphoto.cn\/users\/self\/checkin\/v2 script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/everphoto/everphoto.cookie.js, tag=时光相册 -http-request ^https://group\.baicizhan\.com/group/rewards? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bcz/bcz.cookie.js, tag=百词斩 -http-request ^https:\/\/maicai.api.ddxq.mobi\/point\/home script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.cookie.js, tag=叮咚买菜 -http-request ^https://pm\.m\.fenqile\.com/route0014/star/sign/sign.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js, requires-body=true, tag=分期乐 -http-request ^https:\/\/pm\.m\.fenqile\.com/route0014\/app\/tab\/privilege\/convertTaskReward.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js, requires-body=true, tag=分期乐 -http-request ^https://api\.dushu\.io/CheckIn script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.cookie.js, requires-body=true, tag=樊登读书 -http-request ^https://node\.kg\.qq\.com/webapp/proxy? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.cookie.js, requires-body=true, tag=全民K歌 -http-request ^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.cookie.js, tag=蔚来 -http-request ^https:\/\/wxprdapplet\.gac-nio\.com\/community\/userSignIn\/simpleAuth\/front\/.*\/sign$ script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hycan/hycan.cookie.js, tag=合创 -http-request ^https:\/\/activity-1\.m\.duiba\.com\.cn\/signactivity\/doSign$ requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/haidilao/hdl.js, tag=海底捞 -http-request ^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, tag=网易考拉 -http-request ^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js, tag=WPS -http-request ^https:\/\/xiaoshuo\.qm989\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qimao/qmnovel.js, tag=七猫小说 -http-request ^https:\/\/passport.suning.com\/ids\/login$ script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js, requires-body=true, tag=苏宁易购 -http-request ^https:\/\/luckman.suning.com\/luck-web\/sign\/api\/clock_sign.do script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js, tag=苏宁易购 -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:\/\/frodo\.douban\.com\/api\/v2\/niffler\/check_in\/status script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.cookie.js, tag=豆瓣时间 -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:\/\/api\.1sapp\.com\/sign\/info? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js, tag=趣头条 -http-request ^https:\/\/api\.1sapp\.com\/content\/readV2? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js, tag=趣头条 -http-request ^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.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=米读 -http-request ^https:\/\/www\.duokan\.com\/checkin\/v0\/status script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.cookie.js, requires-body=true, tag=多看 -http-request ^https:\/\/note.youdao.com\/yws\/mapi\/user\?method=checkin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/noteyoudao/noteyoudao.cookie.js, requires-body=true, tag=有道云笔记 -http-response ^https:\/\/clientaccess.10086.cn\/biz-orange\/LN\/uamrandcodelogin\/autoLogin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.fee.cookie.js, tag=中国移动-查话费 -http-response ^https:\/\/clientaccess.10086.cn\/biz-orange\/BN\/realFeeQuery\/getRealFee script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.fee.cookie.js, tag=中国移动-查话费 -http-request ^https:\/\/user-api-prd-mx\.wandafilm\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wanda/wanda.cookie.js, tag=万达电影 -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=智行火车票 - -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, mobwsa.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com +# Chavyleung +http-request ^https?:\/\/tieba\.baidu\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js, tag=百度签到(网页) +http-request ^https:\/\/music.163.com\/weapi\/user\/level script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js, requires-body=true, tag=网易云音乐 +http-request ^https:\/\/www\.smzdm\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/smzdm.cookie.js, tag=什么值得买 +http-request ^https:\/\/www\.v2ex\.com\/mission\/daily script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/v2ex.cookie.js, tag=V2ex +http-request ^https:\/\/(www|live)\.bilibili\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.cookie.js, tag=哔哩哔哩 +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?:\/\/.*\/mobile\-user\/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:\/\/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=顺丰速运 +http-request ^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js, requires-body=true, tag=中国电信 +http-request ^https:\/\/api\.dongqiudi\.com\/v2\/user\/is_login script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dongqiudi/dongqiudi.cookie.js, tag=懂球帝 +http-request ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/yanxuan/yanxuan.cookie.js, tag=网易严选 +http-request ^https:\/\/apk\.tw\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/apktw/apktw.cookie.js, tag=APK.TW +http-request ^https:\/\/user.qunar.com\/webapi\/member\/signIndexV2.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.cookie.js, tag=去哪儿 +http-request ^https:\/\/passport.csdn.net\/v2\/api\/app\/login\/checkAndRefreshToken script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/csdn/csdn.cookie.js, tag=CSDN +http-request ^https:\/\/gw.csdn.net\/mini-app\/v2\/lucky_draw\/login\/sign_in\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/csdn/csdn.cookie.js, tag=CSDN +http-request ^https:\/\/credits.bz.mgtv.com\/user\/creditsTake script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.cookie.js, tag=芒果tv +http-request ^https:\/\/m.gdoil.cn\/webapi\/usersign\/addusersign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.cookie.js, tag=加油广东 +http-request https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/maomicd/maomicd.cookie.js, tag=猫咪音乐 +http-request ^http:\/\/wx.10086.cn\/website\/taskCenter\/index\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.cookie.js, requires-body=true, tag=10086 +http-request ^http:\/\/wx.10086.cn\/website\/taskCenter\/sign\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.cookie.js, requires-body=true, tag=10086 +http-request ^https?:\/\/act.10010.com\/SigninApp\/signin\/querySigninActivity.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js, tag=中国联通 +http-request ^https?:\/\/act.10010.com\/SigninApp(.*?)\/signin\/daySign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js, tag=中国联通 +http-request ^https?:\/\/m.client.10010.com\/dailylottery\/static\/(textdl\/userLogin|active\/findActivityInfo) script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js, tag=中国联通 +http-request ^https:\/\/promotion.waimai.meituan.com\/playcenter\/signIn\/entry script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js, tag=美团外卖 +http-request ^https:\/\/promotion.waimai.meituan.com\/playcenter\/signIn\/doaction script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js, requires-body=true, tag=美团外卖 +http-request ^https:\/\/(.*?)c\.m\.163\.com\/uc\/api\/sign\/v3\/commit script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasenews/neteasenews.cookie.js, requires-body=true, tag=网易新闻 +http-request ^https:\/\/i.meituan.com\/evolve\/signin\/signpost\/ script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.cookie.js, requires-body=true, tag=美团 +http-request ^https:\/\/api.everphoto.cn\/users\/self\/checkin\/v2 script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/everphoto/everphoto.cookie.js, tag=时光相册 +http-request ^https://group\.baicizhan\.com/group/rewards? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bcz/bcz.cookie.js, tag=百词斩 +http-request ^https:\/\/maicai.api.ddxq.mobi\/point\/home script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.cookie.js, tag=叮咚买菜 +http-request ^https://pm\.m\.fenqile\.com/route0014/star/sign/sign.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js, requires-body=true, tag=分期乐 +http-request ^https:\/\/pm\.m\.fenqile\.com/route0014\/app\/tab\/privilege\/convertTaskReward.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js, requires-body=true, tag=分期乐 +http-request ^https://api\.dushu\.io/CheckIn script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.cookie.js, requires-body=true, tag=樊登读书 +http-request ^https://node\.kg\.qq\.com/webapp/proxy? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.cookie.js, requires-body=true, tag=全民K歌 +http-request ^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.cookie.js, tag=蔚来 +http-request ^https:\/\/wxprdapplet\.gac-nio\.com\/community\/userSignIn\/simpleAuth\/front\/.*\/sign$ script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hycan/hycan.cookie.js, tag=合创 +http-request ^https:\/\/activity-1\.m\.duiba\.com\.cn\/signactivity\/doSign$ requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/haidilao/hdl.js, tag=海底捞 +http-request ^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, tag=网易考拉 +http-request ^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js, tag=WPS +http-request ^https:\/\/xiaoshuo\.qm989\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qimao/qmnovel.js, tag=七猫小说 +http-request ^https:\/\/passport.suning.com\/ids\/login$ script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js, requires-body=true, tag=苏宁易购 +http-request ^https:\/\/luckman.suning.com\/luck-web\/sign\/api\/clock_sign.do script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.cookie.js, tag=苏宁易购 +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:\/\/frodo\.douban\.com\/api\/v2\/niffler\/check_in\/status script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.cookie.js, tag=豆瓣时间 +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=米读 +http-request ^https:\/\/www\.duokan\.com\/checkin\/v0\/status script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.cookie.js, requires-body=true, tag=多看 +http-request ^https:\/\/note.youdao.com\/yws\/mapi\/user\?method=checkin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/noteyoudao/noteyoudao.cookie.js, requires-body=true, tag=有道云笔记 +http-response ^https:\/\/clientaccess.10086.cn\/biz-orange\/LN\/uamrandcodelogin\/autoLogin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.fee.cookie.js, tag=中国移动-查话费 +http-response ^https:\/\/clientaccess.10086.cn\/biz-orange\/BN\/realFeeQuery\/getRealFee script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.fee.cookie.js, tag=中国移动-查话费 +http-request ^https:\/\/user-api-prd-mx\.wandafilm\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wanda/wanda.cookie.js, tag=万达电影 +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=智行火车票 + +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, mobwsa.ximalaya.com, *.you.163.com, *.rrys2020.com, ios.zmzapi.com diff --git a/Loon.task.conf b/Loon.task.conf index 5ac28399e21a..495eebb6b8a1 100644 --- a/Loon.task.conf +++ b/Loon.task.conf @@ -1,62 +1,59 @@ -# By chavyleung GitHub:https://github.com/chavyleung/scripts -cron "5 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jd/JD_BaiTiao.js, tag=京东白条 -cron "10 0 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js,tag=百度签到(网页) -cron "50 0 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.js,tag=电信营业厅 -cron "0 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/acfun/acfun.js,tag=AcFun -cron "10 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/apktw/apktw.js,tag=APK.TW -cron "20 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.js,tag=哔哩哔哩 -cron "30 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.silver2coin.js,tag=哔哩哔哩 -cron "40 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dongqiudi/dongqiudi.js,tag=懂球帝 -cron "50 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js,tag=威锋网 -cron "0 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/flyertea/flyertea.js,tag=飞客茶馆 -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 "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 "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=加油广东 -cron "40 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.js,tag=芒果TV -cron "50 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mihoyo/mihoyo.js,tag=米游社 -cron "0 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.js,tag=中国联通 -cron "10 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/maomicd/maomicd.js,tag=猫咪音乐 -cron "20 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.js,tag=中国移动 -cron "30 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.js,tag= 美团外卖 -cron "40 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.js,tag=美团 -cron "50 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/everphoto/everphoto.js,tag=时光相册 -cron "0 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bcz/bcz.js,tag=百词斩 -cron "10 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.js,tag=叮咚买菜 -cron "20 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.js,tag=分期乐 -cron "30 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.js,tag=樊登读书 -cron "40 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.js,tag=全民K歌 -cron "50 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hycan/hycan.js,tag=合创 -cron "0 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.js,tag=蔚来 -cron "10 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/haidilao/hdl.js,tag=海底捞 -cron "20 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wykl/wykl.js,tag=网易考拉 -cron "30 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js,tag=WPS -cron "40 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qimao/qmnovel.js,tag=七猫小说 -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 "30 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.js,tag=豆瓣时间 -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/qtt/qtt.js,tag=趣头条 -cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/midu/miduSign.js,tag=米读签到 -cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/midu/miduRead.js,tag=米读阅读 -cron "0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.js,tag=多看 -cron "3 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/noteyoudao/noteyoudao.js, tag=有道云笔记 -cron "0 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/box/switcher/box.switcher.js, tag=切换会话 -cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.fee.js, tag=中国移动-查话费 -cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wanda/wanda.js, tag=万达电影 -cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/pagoda/pagoda.js, tag=百果园 -cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ithome/ithome.js, tag=IT之家 +# By chavyleung GitHub:https://github.com/chavyleung/scripts +cron "5 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jd/JD_BaiTiao.js, tag=京东白条 +cron "10 0 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js,tag=百度签到(网页) +cron "50 0 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.js,tag=电信营业厅 +cron "0 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/acfun/acfun.js,tag=AcFun +cron "10 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/apktw/apktw.js,tag=APK.TW +cron "20 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.js,tag=哔哩哔哩 +cron "30 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.silver2coin.js,tag=哔哩哔哩 +cron "40 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dongqiudi/dongqiudi.js,tag=懂球帝 +cron "50 1 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js,tag=威锋网 +cron "0 2 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/flyertea/flyertea.js,tag=飞客茶馆 +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 "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 "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=加油广东 +cron "40 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.js,tag=芒果TV +cron "50 4 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mihoyo/mihoyo.js,tag=米游社 +cron "0 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.js,tag=中国联通 +cron "10 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/maomicd/maomicd.js,tag=猫咪音乐 +cron "20 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.js,tag=中国移动 +cron "30 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.js,tag= 美团外卖 +cron "40 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.js,tag=美团 +cron "50 5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/everphoto/everphoto.js,tag=时光相册 +cron "0 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bcz/bcz.js,tag=百词斩 +cron "10 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.js,tag=叮咚买菜 +cron "20 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.js,tag=分期乐 +cron "30 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.js,tag=樊登读书 +cron "40 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.js,tag=全民K歌 +cron "50 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hycan/hycan.js,tag=合创 +cron "0 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.js,tag=蔚来 +cron "10 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/haidilao/hdl.js,tag=海底捞 +cron "20 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wykl/wykl.js,tag=网易考拉 +cron "30 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js,tag=WPS +cron "40 7 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qimao/qmnovel.js,tag=七猫小说 +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 "30 8 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.js,tag=豆瓣时间 +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=多看 +cron "3 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/noteyoudao/noteyoudao.js, tag=有道云笔记 +cron "0 12 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/box/switcher/box.switcher.js, tag=切换会话 +cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.fee.js, tag=中国移动-查话费 +cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wanda/wanda.js, tag=万达电影 +cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/pagoda/pagoda.js, tag=百果园 +cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ithome/ithome.js, tag=IT之家 cron "10 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nfzm/nfzm.js, tag=南方周末 \ No newline at end of file diff --git a/QuantumultX_AppStore_Local_Cookie.conf b/QuantumultX_AppStore_Local_Cookie.conf index 9e958b05de1a..4db89c737f99 100644 --- a/QuantumultX_AppStore_Local_Cookie.conf +++ b/QuantumultX_AppStore_Local_Cookie.conf @@ -143,11 +143,3 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc # 豆瓣时间 ^https:\/\/fro\.douban\.com\/api\/v2\/niffler\/check_in\/status url script-request-header chavyleung/dbsj/dbsj.cookie.js - -# 趣头条 -^https:\/\/api\.1sapp\.com\/sign\/info? url script-request-header chavyleung/qtt/qtt.cookie.js -^https:\/\/api\.1sapp\.com\/content\/readV2? url script-request-header chavyleung/qtt/qtt.cookie.js -^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header chavyleung/qtt/qtt.cookie.js - -# 米读 -^https:\/\/apiwz\.midukanshu\.com url script-request-body chavyleung/midu/midu.cookie.js \ No newline at end of file diff --git a/QuantumultX_Local_Cookie.conf b/QuantumultX_Local_Cookie.conf index 4f6877265637..989e9d917e06 100644 --- a/QuantumultX_Local_Cookie.conf +++ b/QuantumultX_Local_Cookie.conf @@ -139,11 +139,3 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc # 豆瓣时间 ^https:\/\/fro\.douban\.com\/api\/v2\/niffler\/check_in\/status url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.cookie.js - -# 趣头条 -^https:\/\/api\.1sapp\.com\/sign\/info? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -^https:\/\/api\.1sapp\.com\/content\/readV2? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js - -# 米读 -^https:\/\/apiwz\.midukanshu\.com url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/midu/midu.cookie.js \ No newline at end of file diff --git a/QuantumultX_Local_Task.conf b/QuantumultX_Local_Task.conf index 0a8514ca88eb..a1db1922cefb 100644 --- a/QuantumultX_Local_Task.conf +++ b/QuantumultX_Local_Task.conf @@ -88,9 +88,4 @@ # 苏宁易购 7 0 * * * chavyleung/suning/suning.js # 豆瓣时间 -1 0 * * * chavyleung/dbsj/dbsj.js -# 趣头条 -1 0 * * * chavyleung/qtt/qtt.js -# 米读 -*/1 * * * * chavyleung/midu/miduRead.js -1 0 * * * chavyleung/midu/miduSign.js \ No newline at end of file +1 0 * * * chavyleung/dbsj/dbsj.js \ No newline at end of file diff --git a/QuantumultX_Remote_Task.conf b/QuantumultX_Remote_Task.conf index 43882b3967ee..ec8a8eba0405 100644 --- a/QuantumultX_Remote_Task.conf +++ b/QuantumultX_Remote_Task.conf @@ -178,15 +178,3 @@ # 豆瓣时间 1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.js - -# 趣头条 -# 我的 > 右上角签到 -# 首页 > 金币奖励 -# 阅读文章或者播放视频 -1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.js - -# 米读 -# 书城 > 任意文章阅读 -# 我的 > 疯狂摇摇乐 -*/1 * * * * https://raw.githubusercontent.com/chavyleung/scripts/master/midu/miduRead.js -10 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/midu/miduSign.js \ No newline at end of file diff --git a/box/chavy.boxjs.json b/box/chavy.boxjs.json index 2c6f0d37544f..c6673526c1ee 100644 --- a/box/chavy.boxjs.json +++ b/box/chavy.boxjs.json @@ -243,18 +243,6 @@ "https://raw.githubusercontent.com/Orz-3/mini/master/Color/meituan.png" ] }, - { - "id": "qtt", - "name": "趣头条", - "keys": ["senku_signKey_qtt", "senku_signXTK_qtt", "senku_readKey_qtt", "senku_navCoinKey_qtt"], - "author": "@GideonSenku", - "repo": "https://github.com/chavyleung/scripts/tree/master/qtt", - "script": "https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/qtt.png", - "https://raw.githubusercontent.com/Orz-3/mini/master/Color/qtt.png" - ] - }, { "id": "qmkg", "name": "全民K歌", diff --git a/midu/README.md b/midu/README.md deleted file mode 100644 index de37a13279bd..000000000000 --- a/midu/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# 米读 - -> 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 - -> QuanX 需要: v1.0.6-build195 及以后版本 (TestFlight) - -> 感谢 [@GideonSenku](https://github.com/GideonSenku) Commit - -> 2020.04.29 添加阅读时长 -> 2020.04.30 添加签到、掷骰子 -> 2002.05.01 添加阅读双签 -> 2002.05.01 添加签到双签 -> 2020.05.04 使用python生成无限账户签到和阅读JavaScript脚本 -## 配置 (Surge) - -```properties -[MITM] -apiwz.midukanshu.com - -[Script] -http-request ^https:\/\/apiwz\.midukanshu\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/midu/midu.cookie.js, requires-body=true - - -cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/midu/miduSign.js -cron "*/1 * * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/midu/miduRead.js -``` - -## 配置 (QuanX) - -```properties -[MITM] -apiwz.midukanshu.com - -[rewrite_local] - -# [商店版] QuanX v1.0.6-build194 及更早版本 -^https:\/\/apiwz\.midukanshu\.com url script-request-body midu.cookie.js - -# [TestFlight] QuanX v1.0.6-build195 及以后版本 -^https:\/\/apiwz\.midukanshu\.com url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/midu/midu.cookie.js - - - -[task_local] -*/1 * * * * miduRead.js -0 1 * * * miduSign.js -``` - -## 说明 - -0. 越狱用户请关闭越狱状态,否则会视为作弊用户!!! -1. 先把`apiwz.midukanshu.com`加到`[MITM]` -2. 再配置重写规则: - - Surge: 把两条远程脚本放到`[Script]` - - QuanX: 把`midu.cookie.js`和`miduRead.js`&`miduSign.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) -3. 打开 APP 进入`我的` -> `疯狂摇摇乐`,系统提示: `签到:获取Cookie: 成功` -4. 阅读时长获取Cookie:打开 APP 选取文章阅读, `书城` > `任意文章阅读` 等到提示获取Cookie成功即可 -5. 把获取 Cookie 的脚本注释掉 -6. 建议将`miduRead.js`脚本`task`执行次数改成每分钟执行以达到阅读时长 -7. 若要双签到,切换账号获取账户二的Cookie即可 -8. 赞赏:邀请码`A1040276307`,[直达链接](http://html34.qukantoutiao.net/qpr2/bBmQ.html?pid=5eb14518) -9. 无限账户签到请移步:[GideonSenku](https://github.com/GideonSenku/scripts/tree/master/midu),目前支持仅制支持Surge -> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. - -> 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. - -## 常见问题 - -1. 无法写入 Cookie - - - 检查 Surge 系统通知权限放开了没 - - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) - -2. 写入 Cookie 成功, 但签到不成功 - - - 看看是不是在登录前就写入 Cookie 了 - - 如果是,请确保在登录成功后,再尝试写入 Cookie - -3. 为什么有时成功有时失败 - - - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) - - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): - - - `Surge`配置: - - ```properties - # 没有什么是一顿饭解决不了的: - cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 - # 如果有,那就两顿: - cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 - # 实在不行,三顿也能接受: - cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 - - # 再粗暴点,直接: - cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 - ``` - - - `QuanX`配置: - - ```properties - [task_local] - 1 0 * * * xxx.js # 每天00:01执行一次 - 2 0 * * * xxx.js # 每天00:02执行一次 - 3 0 * * * xxx.js # 每天00:03执行一次 - - */60 * * * * xxx.js # 每60分执行一次 - ``` - -## 感谢 - -[@NobyDa](https://github.com/NobyDa) - -[@lhie1](https://github.com/lhie1) - -[@ConnersHua](https://github.com/ConnersHua) - -[@GideonSenku](https://github.com/GideonSenku) diff --git a/midu/midu.cookie.js b/midu/midu.cookie.js deleted file mode 100644 index ccf31fecf48c..000000000000 --- a/midu/midu.cookie.js +++ /dev/null @@ -1,171 +0,0 @@ -// 账号一 -const readTimeheaderKey = 'senku_readTimeheader_midu' -const signbodyKey = 'senku_signbody_midu' -// 账号二 -const readTimeheaderKey2 = 'senku_readTimeheader_midu2' -const signbodyKey2 = 'senku_signbody_midu2' - -const senku = init() -const requrl = $request.url - - -if ($request && $request.method != 'OPTIONS' && requrl.match(/\/user\/readTimeBase\/readTime/)) { - try { - const readTimebodyVal = $request.body - const CookieValue = $request.headers - senku.log(`🍎${readTimebodyVal}`) - senku.log(`🍎${senku.getdata(readTimebodyKey)}`) - var account = senku.getdata('tokenMidu_read') ? senku.getdata('tokenMidu_read') : null - var account2 = senku.getdata('tokenMidu_read2') ? senku.getdata('tokenMidu_read2') : null - var tokenVal = CookieValue['token'] - if (!account || tokenVal == account) { - var CookieName = '【账号一】' - var CookieKey = 'senku_readTimeheader_midu' - var tokenKey = 'tokenMidu_read' - var readTimebodyKey = 'senku_readTimebody_midu' - } else if (!account2 || tokenVal == account2) { - var CookieName = '【账号二】' - var CookieKey = 'senku_readTimeheader_midu2' - var tokenKey = 'tokenMidu_read2' - var readTimebodyKey = 'senku_readTimebody_midu2' - } - senku.log(`🍎${CookieName}`) - if (CookieName && senku.getdata(tokenKey)) { - if (senku.getdata(tokenKey) != tokenVal) { - var token = senku.setdata(tokenVal, tokenKey) - var header = senku.setdata(JSON.stringify(CookieValue), CookieKey) - var body = senku.setdata(readTimebodyVal, readTimebodyKey) - senku.setdata(readTimebodyVal, readTimebodyKey) - senku.log(`🔔${readTimebodyVal}`) - senku.log(`🔔${JSON.stringify(CookieValue)}`) - if (!token && !header && !body) { - senku.msg("米读", "阅读文章数据", "获取Cookie失败 ‼️") - senku.msg("米读", "阅读", "更新" + CookieName + "Cookie失败 ‼️") - } else { - senku.msg("米读", "阅读文章数据", "获取Cookie成功 🎉") - senku.msg("米读", "阅读", "更新" + CookieName + "Cookie成功 🎉") - } - } - } else if (CookieName) { - var token = senku.setdata(tokenVal, tokenKey) - var header = senku.setdata(CookieValue['tk'], CookieKey) - var body = senku.setdata(readTimebodyVal, readTimebodyKey) - senku.log(`🍎${tokenVal}`) - senku.log(`🔔${readTimebodyVal}`) - if (!header && !token && !body) { - senku.msg("米读", "阅读文章数据", "获取Cookie失败 ‼️") - senku.msg("米读", "阅读", "首次写入" + CookieName + "Cookie失败 ‼️") - } else { - senku.setdata('no', 'bind') - senku.msg("米读", "阅读文章数据", "获取Cookie成功 🎉") - senku.msg("米读", "阅读", "首次写入" + CookieName + "Cookie成功 🎉") - } - } else { - senku.msg("米读", "更新米读->阅读Cookie失败", '非历史写入账号 ‼️') - } - - } catch (error) { - senku.log(`❌error:${error}`) - } -} - -if ($request && $request.method != 'OPTIONS' && requrl.match(/\/wz\/dice\/index/)) { - try { - var CookieValue = $request.body - var account = senku.getdata('tokenMidu_sign') ? senku.getdata('tokenMidu_sign') : null - var account2 = senku.getdata('tokenMidu_sign2') ? senku.getdata('tokenMidu_sign2') : null - var tkVal = CookieValue.match(/token=[a-zA-Z0-9._-]+/)[0] - var tokenVal = tkVal.substring(6, tkVal.length) - if (!account || tokenVal == account) { - var CookieName = '【账号一】' - var CookieKey = 'senku_signbody_midu' - var tokenKey = 'tokenMidu_sign' - } else if (!account2 || tokenVal == account2) { - var CookieName = '【账号二】' - var CookieKey = 'senku_signbody_midu2' - var tokenKey = 'tokenMidu_sign2' - } else { - senku.msg("米读", "更新米读->签到Cookie失败", '非历史写入账号 ‼️') - } - senku.log(`🍎${senku.getdata(tokenKey)}`) - senku.log(`🍎${tokenVal}`) - if (senku.getdata(tokenKey)) { - if (senku.getdata(tokenKey) != tokenVal) { - var token = senku.setdata(tokenVal, tokenKey) - var body = senku.setdata(CookieValue, CookieKey) - if (!body && !token) { - senku.msg("米读", "签到", "更新" + CookieName + "Cookie失败 ‼️") - } else { - senku.msg("米读", "签到", "更新" + CookieName + "Cookie成功 🎉") - } - } - } else { - var token = senku.setdata(tokenVal, tokenKey) - var body = senku.setdata(CookieValue, CookieKey) - senku.log(`🍎${tokenVal}`) - if (!body && !token) { - senku.msg("米读", "签到", "首次写入" + CookieName + "Cookie失败 ‼️") - } else { - senku.setdata('no', 'bind') - senku.msg("米读", "签到", "首次写入" + CookieName + "Cookie成功 🎉") - } - } - } catch (error) { - senku.log(`❌error:${error}`) - } -} - -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() \ No newline at end of file diff --git a/midu/miduRead.js b/midu/miduRead.js deleted file mode 100644 index 1aa841899f07..000000000000 --- a/midu/miduRead.js +++ /dev/null @@ -1,372 +0,0 @@ -// 赞赏:邀请码`A1040276307` -// 链接`http://html34.qukantoutiao.net/qpr2/bBmQ.html?pid=5eb14518` -// 农妇山泉 -> 有点咸 - -/******************** - * 1、 为了方便任意脚本可以清除Cookie, 任意一个脚本将DeleteCookie = true且选择要清除的账号都可以生效 - * 2、 debug模式可以在Surge&&Qx中开启,方便你判定多用户及脚本运行情况 - * 3、 Qx==>dubug:miduRede构造请求 - * 4、 Surge==>debug:load脚本->evalaute - * 5、脚本默认每半小时通知一次,建议自己先debug看看是否成功 - *********************/ - -// 是否开启清除Cookie -const DeleteCookie = false // 清除所有Cookie,将下方改为true,默认false - -// 选取清除操作 -const DeleteCookieAll = false // 清除所有 -const DeleteCookieOne = false // 清除账户一 -const DeleteCookieTwo = false // 清除账户二 - -const debug = false // 开启debug模式,每次脚本执行会显示通知,默认false - -const bind = true // 绑定作者邀请码,默认true,可更改为false - -const cookieName = '米读阅读时长' - -const senku = init() - -debug ? senku.setdata('true', 'debug') : senku.setdata('false', 'debug') -bind ? '' : senku.setdata('', 'bind'); -if (DeleteCookie) { - const one = senku.getdata('tokenMidu_read') - const two = senku.getdata('tokenMidu_sign') - const three = senku.getdata('tokenMidu_read2') - const four = senku.getdata('tokenMidu_sign2') - if (DeleteCookieAll) { - if (one || two || three || four) { - senku.setdata("", 'senku_signbody_midu') - senku.setdata("", 'senku_signbody_midu2') - senku.setdata("", 'senku_readTimebody_midu') - senku.setdata("", 'senku_readTimebody_midu2') - senku.setdata("", 'senku_readTimeheader_midu') - senku.setdata("", 'senku_readTimeheader_midu2') - senku.setdata("", "tokenMidu_read") - senku.setdata("", "tokenMidu_read2") - senku.setdata("", "tokenMidu_sign") - senku.setdata("", "tokenMidu_sign2") - senku.msg("米读 Cookie清除成功 !", "", '请手动关闭脚本内"DeleteCookie"选项') - } else { - senku.msg("米读 无可清除的Cookie !", "", '请手动关闭脚本内"DeleteCookie"选项') - } - } else if (DeleteCookieOne) { - if (one || two) { - senku.setdata("", 'senku_signbody_midu') - senku.setdata("", 'senku_readTimebody_midu') - senku.setdata("", 'senku_readTimeheader_midu') - senku.setdata("", "tokenMidu_read") - senku.setdata("", "tokenMidu_sign") - senku.msg("米读 Cookie清除成功 !", "清除账户一选项", '请手动关闭脚本内"DeleteCookie"选项') - } else { - senku.msg("米读 无可清除的Cookie !", "清除账户一选项", '请手动关闭脚本内"DeleteCookie"选项') - } - } else if (DeleteCookieTwo) { - if (three || four) { - senku.setdata("", 'senku_signbody_midu2') - senku.setdata("", 'senku_readTimebody_midu2') - senku.setdata("", 'senku_readTimeheader_midu2') - senku.setdata("", "tokenMidu_read2") - senku.setdata("", "tokenMidu_sign2") - senku.msg("米读 Cookie清除成功 !", "清除账户二选项", '请手动关闭脚本内"DeleteCookie"选项') - } else { - senku.msg("米读 无可清除的Cookie !", "清除账户二选项", '请手动关闭脚本内"DeleteCookie"选项') - } - } else { - senku.msg("米读 清除Cookie !", "未选取任何选项", '请手动关闭脚本内"DeleteCookie"选项') - } -} - - -function initial() { - signinfo = { - addnumList: [], - rollList: [], - doubleList: [] - } -} - -; -(sign = () => { - senku.log(`🔔 ${cookieName}`) - senku.getdata('tokenMidu_read') ? '' : senku.msg('米读阅读', '', '不存在Cookie') - DualAccount = true - if (senku.getdata('tokenMidu_read')) { - tokenVal = senku.getdata('tokenMidu_read') - readTimeheaderVal = senku.getdata('senku_readTimeheader_midu') - readTimebodyVal = senku.getdata('senku_readTimebody_midu') - signbodyVal = senku.getdata('senku_signbody_midu') - all() - } - senku.done() -})() - - -async function all() { - try { - senku.log(`🍎${readTimeheaderVal}`) - const headerVal = readTimeheaderVal - const urlVal = readTimebodyVal - const key = signbodyVal - const token = tokenVal - initial() - - await readTime(headerVal, token, urlVal) - await userInfo(key) - await prizeInfo(key) - if (signinfo.prizeInfo && signinfo.prizeInfo.data && signinfo.prizeInfo.data.total_num) { - await prizeTask(key) - await drawPrize(key) - } - await showmsg() - senku.done() - } catch (e) { - senku.msg(cookieName, `失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} - 失败: ${e}`) - senku.done() - } -} - -function double() { - initial() - DualAccount = false - if (senku.getdata('tokenMidu_read2')) { - tokenVal = senku.getdata('tokenMidu_read2') - readTimeheaderVal = senku.getdata('senku_readTimeheader_midu2') - readTimebodyVal = senku.getdata('senku_readTimebody_midu2') - signbodyVal = senku.getdata('senku_signbody_midu2') - all() - } -} -// 抽奖 -function drawPrize(bodyVal) { - return new Promise((resolve, reject) => { - const drawPrizeurlVal = 'https://apiwz.midukanshu.com/wz/task/drawPrize?' + bodyVal - const url = { - url: drawPrizeurlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) - if (data) { - signinfo.drawPrize = JSON.parse(data) - } - resolve() - } catch (e) { - // senku.msg(cookieName, `抽奖: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} drawPrize - 抽奖失败: ${e}`) - senku.log(`❌ ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 观看视频获取抽奖机会 -function prizeTask(bodyVal) { - return new Promise((resolve, reject) => { - const prizeTaskurlVal = 'https://apiwz.midukanshu.com/wz/task/prizeTask?' + bodyVal - const url = { - url: prizeTaskurlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(response)}`) - if (data) { - signinfo.prizeTask = JSON.parse(data) - } - resolve() - } catch (e) { - // senku.msg(cookieName, `观看视频抽奖: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} prizeTask - 观看视频抽奖失败: ${e}`) - senku.log(`❌ ${cookieName} prizeTask - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 抽奖信息 -function prizeInfo(bodyVal) { - return new Promise((resolve, reject) => { - const prizeInfourlVal = 'https://apiwz.midukanshu.com/wz/task/prizeList?' + bodyVal - const url = { - url: prizeInfourlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) - if (data) { - signinfo.prizeInfo = JSON.parse(data) - } - resolve() - } catch (e) { - // senku.msg(cookieName, `抽奖信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} prizeInfo - 抽奖信息失败: ${e}`) - senku.log(`❌ ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} -// 阅读时长 -function readTime(header, token, urlVal) { - return new Promise((resolve, reject) => { - const url = { - url: 'https://apiwz.midukanshu.com/user/readTimeBase/readTime?' + urlVal, - headers: { - 'host': 'apiwz.midukanshu.com', - 'versionName': '1.7.2.0501.1930', - "User-Agent": "MRSpeedNovel/0430.1512 CFNetwork/1125.2 Darwin/19.5.0", - "Content-Type": "application/x-www-form-urlencoded; charset=utf-8", - 'token': token, - 'tk': header - } - } - - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} readTime - response: ${JSON.stringify(response)}`) - if (data) { - signinfo.readTime = JSON.parse(data) - } - resolve() - } catch (e) { - // senku.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} readTime - 阅读时长失败: ${e}`) - senku.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 用户信息 -function userInfo(bodyVal) { - return new Promise((resolve, reject) => { - const userInfourlVal = 'https://apiwz.midukanshu.com/wz/user/getInfo?' + bodyVal - const url = { - url: userInfourlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) - if (data) { - signinfo.userInfo = JSON.parse(data) - } - resolve() - } catch (e) { - // senku.msg(cookieName, `用户信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} userInfo - 用户信息失败: ${e}`) - senku.log(`❌ ${cookieName} userInfo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -function showmsg() { - return new Promise((resolve, reject) => { - let subTitle = '' - let detail = '' - const name = signinfo.userInfo && signinfo.userInfo.data && signinfo.userInfo.data.nickname ? signinfo.userInfo.data.nickname : `账户已退出` - if (signinfo.readTime && signinfo.readTime.code == 0) { - const coin = signinfo.readTime.data.coin - const readTotalMinute = signinfo.readTime.data.readTotalMinute - const total_coin = signinfo.readTime.data.total_coin - coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰` - readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` - } else if (signinfo.readTime && signinfo.readTime.code != 0) { - detail += `【阅读时长】错误代码${signinfo.readTime.code},错误信息${signinfo.readTime.message}` - senku.msg(cookieName + ` 用户:${name}`, subTitle, detail) - } - - if (senku.getdata('debug') == 'true' || detail && signinfo.readTime && signinfo.readTime.data && signinfo.readTime.data.readTotalMinute % 60 == 0) { - senku.msg(cookieName + ` 用户:${name}`, subTitle, detail) - } else if (senku.getdata('debug') == 'true' || signinfo.readTime && signinfo.readTime.data && signinfo.readTime.data.readTotalMinute % 60 == 0) { - senku.msg(cookieName + ` 用户:${name}`, '阅读结果', '时间未到') - } - - // 大转盘抽手机 - // if (signinfo.drawPrize) { - // if (signinfo.drawPrize.code == 0) { - // detail += `【转盘奖励】本次${drawPrize.data.title}\n` - // } else { - // detail += `【转盘奖励】无次数抽奖` - // } - // senku.msg(cookieName + ` 用户:${name}`, subTitle, detail) - // } - if (DualAccount) double() - resolve() - }) -} - - -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, resp.body)) - } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) - } - } - done = (value = {}) => { - $done(value) - } - return { - isSurge, - isQuanX, - msg, - log, - getdata, - setdata, - get, - post, - done - } -} \ No newline at end of file diff --git a/midu/miduRead.py b/midu/miduRead.py deleted file mode 100644 index 2f7b38f63ea2..000000000000 --- a/midu/miduRead.py +++ /dev/null @@ -1,174 +0,0 @@ -""" -@author: GideonSenku, modified by pysta -@file: SurgeToJs.py -@createTime: 2020-05-01 - -本脚本用作曲线双阅读,结合APP:py3使用 -1、登陆要阅读的账号一、二、三.....,理论无限 -2、Surge抓包记录找到https://apiwz.midukanshu.com/user/readTimeBase/readTime选择该记录导出,使用pythonista3运行miduRead.py -3、在Surge->脚本->新增, 脚本名:自定义不要重复就好, 脚本类型选择Cron, cron表达式: */1 * * * * 脚本位置->本地 -4、编辑脚本:贴贴py3的结果 -""" - -import zipfile -import json -import appex -import clipboard -import console - - -def get_request_data(path): - - with zipfile.ZipFile(path, 'r') as z: - with z.open('model.json') as f: - data = json.load(f) - if 'request.dump' in z.namelist(): - with z.open('request.dump') as f: - body = str(f.read(), encoding='utf-8') - data['requestBody'] = body - return data - - -path = appex.get_file_path() -data = get_request_data(path) - -body = data.get('requestBody', '') -url = data['URL'] -method = data['method'].lower() -headers = {k: v for k, v in [ - i.split(': ', 1) for i in data['requestHeader'].split('\r\n')[1:] if i]} - -js = """ -// 赞赏:邀请码`A1040276307` -// 链接`http://html34.qukantoutiao.net/qpr2/bBmQ.html?pid=5eb14518` -// 农妇山泉 -> 有点咸 - -const cookieName = '米读阅读时长' -const signinfo = {} -const senku = init() -// 开启debug模式,每次脚本执行会显示通知,默认false -const debug = false - - -debug ? senku.setdata('true', 'debug') : senku.setdata('false', 'debug') -""" -js = js + f''' -const urlVal = {json.dumps(url)} -const bodyVal = {json.dumps(body)} -const headerVal = {json.dumps(headers, indent=4)} -const request = {{ - url: urlVal, - headers: headerVal, - body: bodyVal -}} - -''' -js = js + """ -; -(sign = async () => { - senku.log(`🔔 ${cookieName}`) - await readTime() - showmsg() - senku.done() -})().catch((e) => senku.log(`❌ ${cookieName} 签到失败: ${e}`), senku.done()) - - -// 阅读时长 -function readTime() { - return new Promise((resolve, reject) => { - senku.post(request, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(response)}`) - signinfo.readTime = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} readTime - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -function showmsg() { - let subTitle = '' - let detail = '' - if (signinfo.readTime && signinfo.readTime.code == 0) { - const coin = signinfo.readTime.data.coin - const readTotalMinute = signinfo.readTime.data.readTotalMinute - const total_coin = signinfo.readTime.data.total_coin - coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰` - readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` - } else if (signinfo.readTime.code != 0) { - detail += `【阅读时长】错误代码${signinfo.readTime.code},错误信息${signinfo.readTime.message}` - senku.msg(cookieName, subTitle, detail) - } else { - detail += '【阅读时长】失败' - senku.msg(cookieName, subTitle, detail) - } - - if (senku.getdata('debug') == 'true' || detail && signinfo.readTime.data.readTotalMinute % 60 == 0) { - senku.msg(cookieName, subTitle, detail) - } else if (senku.getdata('debug') == 'true' || signinfo.readTime.data.readTotalMinute % 60 == 0) { - senku.msg(cookieName, '阅读结果', '时间未到') - } -} - -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, resp.body)) - } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) - } - } - done = (value = {}) => { - $done(value) - } - return { - isSurge, - isQuanX, - msg, - log, - getdata, - setdata, - get, - post, - done - } -} -""" -print(js) -clipboard.set(js) -console.hud_alert('Copyed!') diff --git a/midu/miduSign.js b/midu/miduSign.js deleted file mode 100644 index 0806b8d446c6..000000000000 --- a/midu/miduSign.js +++ /dev/null @@ -1,453 +0,0 @@ -// 赞赏:邀请码`A1040276307` -// 链接`http://html34.qukantoutiao.net/qpr2/bBmQ.html?pid=5eb14518` -// 农妇山泉 -> 有点咸 - -/******************** - * 1、 为了方便任意脚本可以清除Cookie, 任意一个脚本将DeleteCookie = true且选择要清除的账号都可以生效 - * 2、 debug模式可以在Surge&&Qx中开启,方便你判定多用户及脚本运行情况 - * 3、 Qx==>dubug:miduRede构造请求 - * 4、 Surge==>debug:load脚本->evalaute - * 5、脚本默认每半小时通知一次,建议自己先debug看看是否成功 - *********************/ - -// 是否开启清除Cookie -const DeleteCookie = false // 清除所有Cookie,将下方改为true,默认false - -// 选取清除操作 -const DeleteCookieAll = false // 清除所有 -const DeleteCookieOne = false // 清除账户一 -const DeleteCookieTwo = false // 清除账户二 - -const bind = true // 绑定作者邀请码,默认true,可更改为false - -const cookieName = '米读' -const senku = init() - -if (DeleteCookie) { - const one = senku.getdata('tokenMidu_read') - const two = senku.getdata('tokenMidu_sign') - const three = senku.getdata('tokenMidu_read2') - const four = senku.getdata('tokenMidu_sign2') - if (DeleteCookieAll) { - if (one || two || three || four) { - senku.setdata("", 'senku_signbody_midu') - senku.setdata("", 'senku_signbody_midu2') - senku.setdata("", 'senku_readTimebody_midu') - senku.setdata("", 'senku_readTimebody_midu2') - senku.setdata("", 'senku_readTimeheader_midu') - senku.setdata("", 'senku_readTimeheader_midu2') - senku.setdata("", "tokenMidu_read") - senku.setdata("", "tokenMidu_read2") - senku.setdata("", "tokenMidu_sign") - senku.setdata("", "tokenMidu_sign2") - senku.msg("米读 Cookie清除成功 !", "", '请手动关闭脚本内"DeleteCookie"选项') - } else { - senku.msg("米读 无可清除的Cookie !", "", '请手动关闭脚本内"DeleteCookie"选项') - } - } else if (DeleteCookieOne) { - if (one || two) { - senku.setdata("", 'senku_signbody_midu') - senku.setdata("", 'senku_readTimebody_midu') - senku.setdata("", 'senku_readTimeheader_midu') - senku.setdata("", "tokenMidu_read") - senku.setdata("", "tokenMidu_sign") - senku.msg("米读 Cookie清除成功 !", "清除账户一选项", '请手动关闭脚本内"DeleteCookie"选项') - } else { - senku.msg("米读 无可清除的Cookie !", "清除账户一选项", '请手动关闭脚本内"DeleteCookie"选项') - } - } else if (DeleteCookieTwo) { - if (three || four) { - senku.setdata("", 'senku_signbody_midu2') - senku.setdata("", 'senku_readTimebody_midu2') - senku.setdata("", 'senku_readTimeheader_midu2') - senku.setdata("", "tokenMidu_read2") - senku.setdata("", "tokenMidu_sign2") - senku.msg("米读 Cookie清除成功 !", "清除账户二选项", '请手动关闭脚本内"DeleteCookie"选项') - } else { - senku.msg("米读 无可清除的Cookie !", "清除账户二选项", '请手动关闭脚本内"DeleteCookie"选项') - } - } else { - senku.msg("米读 清除Cookie !", "未选取任何选项", '请手动关闭脚本内"DeleteCookie"选项') - } -} - -function initial() { - signinfo = { - addnumList: [], - rollList: [], - doubleList: [] - } -} - -bind ? '' : senku.setdata('', 'bind') - - -; -(sign = () => { - senku.log(`🔔 ${cookieName}`) - senku.getdata('tokenMidu_sign') ? '' : senku.msg('米读签到', '', '不存在Cookie') - DualAccount = true - if (senku.getdata('tokenMidu_sign')) { - tokenVal = senku.getdata('tokenMidu_read') - readTimeheaderVal = senku.getdata('senku_readTimeheader_midu') - readTimebodyVal = senku.getdata('senku_readTimebody_midu') - signbodyVal = senku.getdata('senku_signbody_midu') - all() - } -})() - -async function all() { - try { - senku.log(`🍎${signbodyVal}`) - const headerVal = readTimeheaderVal - const urlVal = readTimebodyVal - const key = signbodyVal - const token = tokenVal - initial() - await userInfo(key) - await signDay(key) - await signVideo(key) - await dice_index(key) - if (signinfo.dice_index && signinfo.dice_index.code == 0) { - const remain_add_num = signinfo.dice_index.data.remain_add_chance_num - - for (let index = 0; index < remain_add_num; index++) { - await dice_addnum(key) - } - await dice_index(key) - const chance_num = signinfo.dice_index.data.chance_num - for (let index = 0; index < chance_num; index++) { - await dice_roll(key) - await dice_double(key) - } - } - - if (senku.getdata('bind')) { - await Bind() - } - await showmsg() - senku.done() - } catch (e) { - senku.msg(cookieName, `失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} - 失败: ${e}`) - senku.done() - } -} - -function double() { - initial() - DualAccount = false - if (senku.getdata('tokenMidu_sign2')) { - tokenVal = senku.getdata('tokenMidu_read2') - readTimeheaderVal = senku.getdata('senku_readTimeheader_midu2') - readTimebodyVal = senku.getdata('senku_readTimebody_midu2') - signbodyVal = senku.getdata('senku_signbody_midu2') - all() - } -} - -// 绑定 -function Bind() { - return new Promise((resolve, reject) => { - const BindurlVal = 'http://fisson.1sapp.com/nlx/shareLink/tmpBind' - const url = { - url: BindurlVal, - headers: {}, - body: 'app_id=7&act_type=1&act_name=grad_pupil&invite_code=A1040276307&telephone=' + signinfo.userInfo.data.mobile - } - url.headers['Host'] = 'fisson.1sapp.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - senku.setdata('', 'bind') - resolve() - }) - }) -} - -// 用户信息 -function userInfo(bodyVal) { - return new Promise((resolve, reject) => { - const userInfourlVal = 'https://apiwz.midukanshu.com/wz/user/getInfo?' + bodyVal - const url = { - url: userInfourlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) - signinfo.userInfo = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `获取用户信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} userInfo - 获取用户信息失败: ${e}`) - senku.log(`❌ ${cookieName} userInfo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - - -// 骰子信息 -function dice_index(bodyVal) { - return new Promise((resolve, reject) => { - const dice_index_urlVal = 'https://apiwz.midukanshu.com/wz/dice/index?' + bodyVal - const url = { - url: dice_index_urlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_index - response: ${JSON.stringify(response)}`) - signinfo.dice_index = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `骰子信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_index - 骰子信息失败: ${e}`) - senku.log(`❌ ${cookieName} dice_index - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 掷骰子 -function dice_roll(bodyVal) { - return new Promise((resolve, reject) => { - const dice_roll_urlVal = 'https://apiwz.midukanshu.com/wz/dice/roll?' + bodyVal - const url = { - url: dice_roll_urlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(response)}`) - if (JSON.parse(data).code == 0) { - signinfo.rollList.push(JSON.parse(data)) - } - resolve() - } catch (e) { - senku.msg(cookieName, `掷骰子: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_roll - 掷骰子失败: ${e}`) - senku.log(`❌ ${cookieName} dice_roll - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 骰子双倍奖励 -function dice_double(bodyVal) { - return new Promise((resolve, reject) => { - const dice_double_urlVal = 'https://apiwz.midukanshu.com/wz/dice/doubleReward?' + bodyVal - const url = { - url: dice_double_urlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(response)}`) - if (JSON.parse(data).code == 0) { - signinfo.doubleList.push(JSON.parse(data)) - } - resolve() - } catch (e) { - senku.msg(cookieName, `骰子双倍奖励: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_double - 骰子双倍奖励失败: ${e}`) - senku.log(`❌ ${cookieName} dice_double - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 获取骰子次数 -function dice_addnum(bodyVal) { - return new Promise((resolve, reject) => { - const dice_addnum_urlVal = 'https://apiwz.midukanshu.com/wz/dice/addChangeNumByRewardVideo?' + bodyVal - const url = { - url: dice_addnum_urlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_4_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 miduapp qapp' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_addnum - response: ${JSON.stringify(response)}`) - if (JSON.parse(data).code == 0) { - signinfo.addnumList.push(JSON.parse(data)) - } - resolve() - } catch (e) { - senku.msg(cookieName, `获取骰子次数: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_addnum - 获取骰子次数失败: ${e}`) - senku.log(`❌ ${cookieName} dice_addnum - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 每日签到 -function signDay(bodyVal) { - return new Promise((resolve, reject) => { - const signurlVal = 'https://apiwz.midukanshu.com/wz/task/signInV2?' + bodyVal - const url = { - url: signurlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(response)}`) - signinfo.signDay = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signDay - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 签到视频奖励 -function signVideo(bodyVal) { - return new Promise((resolve, reject) => { - const signVideourlVal = 'https://apiwz.midukanshu.com/wz/task/signVideoReward?' + bodyVal - const url = { - url: signVideourlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(response)}`) - signinfo.signVideo = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `签到视频: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signVideo - 签到视频失败: ${e}`) - senku.log(`❌ ${cookieName} signVideo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - - -function showmsg() { - return new Promise((resolve, reject) => { - let subTitle = '' - let detail = '' - const name = signinfo.userInfo.data.nickname ? signinfo.userInfo.data.nickname : `未设置昵称` - // 签到信息 - if (signinfo.signDay && signinfo.signDay.code == 0) { - if (signinfo.signDay.data) { - const amount = signinfo.signDay.data.amount - amount ? detail += `【签到奖励】获得${amount}💰\n` : detail += `【签到奖励】已获取过奖励\n` - } - } else subTitle += '签到:失败' - - if (signinfo.signVideo && signinfo.signVideo.code == 0) { - const amount = signinfo.signVideo.data.amount - amount ? detail += `【签到视频】获得${amount}💰\n` : detail += `【签到视频】已获取过奖励\n` - } else subTitle += '签到视频:失败' - - // 骰子信息 - // 次数 - if (signinfo.addnumList.length > 0) { - detail += `【骰子次数】增加${signinfo.addnumList.length}次\n` - } else { - detail += `【骰子次数】无次数增加\n` - } - // 掷骰子 - if (signinfo.rollList.length > 0) { - let i = 0 - for (const roll of signinfo.rollList) { - i += 1 - roll.code == 0 ? detail += `【骰子奖励】第${i}次${roll.data.roll_coin}💰\n` : detail += `【骰子奖励】已获取过奖励\n` - } - } else { - detail += `【骰子奖励】无次数掷骰子\n` - } - senku.msg(cookieName + ` 用户:${name}`, subTitle, detail) - if (DualAccount) double() - resolve() - }) -} - - - -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, resp.body)) - } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) - } - } - done = (value = {}) => { - $done(value) - } - return { - isSurge, - isQuanX, - msg, - log, - getdata, - setdata, - get, - post, - done - } -} \ No newline at end of file diff --git a/midu/miduSign.py b/midu/miduSign.py deleted file mode 100644 index 0703d9352644..000000000000 --- a/midu/miduSign.py +++ /dev/null @@ -1,479 +0,0 @@ -""" -@author: GideonSenku, modified by pysta -@file: SurgeToJs.py -@createTime: 2020-05-01 - -本脚本用作曲线双阅读,结合APP:py3使用 -1、登陆要阅读的账号一、二、三.....,理论无限 -2、Surge抓包记录找到https://apiwz.midukanshu.com/wz/dice/index,选择该记录导出,使用pythonista3运行miduSign.py -3、在Surge->脚本->新增, 脚本名:自定义不要重复就好, 脚本类型选择Cron, cron表达式: */1 * * * * 脚本位置->本地 -54、编辑脚本:贴贴py3的结果 -""" - -import zipfile -import json -import appex -import clipboard -import console - - -def get_request_data(path): - - with zipfile.ZipFile(path, 'r') as z: - with z.open('model.json') as f: - data = json.load(f) - if 'request.dump' in z.namelist(): - with z.open('request.dump') as f: - body = str(f.read(), encoding='utf-8') - data['requestBody'] = body - return data - - -path = appex.get_file_path() -data = get_request_data(path) - -body = data.get('requestBody', '') -url = data['URL'] -method = data['method'].lower() -headers = {k: v for k, v in [ - i.split(': ', 1) for i in data['requestHeader'].split('\r\n')[1:] if i]} - -js = """ -// 赞赏:邀请码`A1040276307` -// 链接`http://html34.qukantoutiao.net/qpr2/bBmQ.html?pid=5eb14518` -// 农妇山泉 -> 有点咸 - -const cookieName = '米读' - -const senku = init() - - -const signinfo = { - addnumList: [], - rollList: [], - doubleList: [] -} -""" -js = js + f''' -const urlVal = {json.dumps(url)} -const bodyVal = {json.dumps(body)} -const headerVal = {json.dumps(headers, indent=4)} -const request = {{ - url: urlVal, - headers: headerVal, - body: bodyVal -}} - -''' -js = js + """ - -; -(sign = async () => { - senku.log(`🔔 ${cookieName}`) - await userInfo() - await signDay() - await signVideo() - await dice_index() - if (signinfo.dice_index && signinfo.dice_index.code == 0) { - const remain_add_num = signinfo.dice_index.data.remain_add_chance_num - - for (let index = 0; index < remain_add_num; index++) { - await dice_addnum() - } - await dice_index() - const chance_num = signinfo.dice_index.data.chance_num - for (let index = 0; index < chance_num; index++) { - await dice_roll() - await dice_double() - } - } - await userInfo() - await prizeInfo() - if (signinfo.prizeInfo.data.total_num) { - await prizeTask() - await drawPrize() - } - await Bind() - showmsg() - senku.done() -})().catch((e) => senku.log(`❌ ${cookieName} 签到失败: ${e}`), senku.done()) - - -// 用户信息 -function userInfo() { - return new Promise((resolve, reject) => { - const userInfourlVal = 'https://apiwz.midukanshu.com/wz/user/getInfo?' + bodyVal - const url = { - url: userInfourlVal, - headers: headerVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) - signinfo.userInfo = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `获取用户信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} userInfo - 获取用户信息失败: ${e}`) - senku.log(`❌ ${cookieName} userInfo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} -// 绑定 -function Bind() { - return new Promise((resolve, reject) => { - const BindurlVal = 'http://fisson.1sapp.com/nlx/shareLink/tmpBind' - const url = { - url: BindurlVal, - headers: {}, - body: 'app_id=7&act_type=1&act_name=grad_pupil&invite_code=A1040276307&telephone=' + signinfo.userInfo.data.mobile - } - url.headers['Host'] = 'fisson.1sapp.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - senku.setdata('', 'bind') - resolve() - }) - }) -} -// 抽奖 -function drawPrize() { - return new Promise((resolve, reject) => { - const drawPrizeurlVal = 'https://apiwz.midukanshu.com/wz/task/drawPrize?' + bodyVal - const url = { - url: drawPrizeurlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) - signinfo.drawPrize = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `抽奖: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} drawPrize - 抽奖失败: ${e}`) - senku.log(`❌ ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 观看视频获取抽奖机会 -function prizeTask() { - return new Promise((resolve, reject) => { - const prizeTaskurlVal = 'https://apiwz.midukanshu.com/wz/task/prizeTask?' + bodyVal - const url = { - url: prizeTaskurlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(response)}`) - signinfo.prizeTask = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `观看视频抽奖: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} prizeTask - 观看视频抽奖失败: ${e}`) - senku.log(`❌ ${cookieName} prizeTask - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 抽奖信息 -function prizeInfo() { - return new Promise((resolve, reject) => { - const prizeInfourlVal = 'https://apiwz.midukanshu.com/wz/task/prizeList?' + bodyVal - const url = { - url: prizeInfourlVal, - headers: {} - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) - signinfo.prizeInfo = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `抽奖信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} prizeInfo - 抽奖信息失败: ${e}`) - senku.log(`❌ ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 骰子信息 -function dice_index() { - return new Promise((resolve, reject) => { - const dice_index_urlVal = 'https://apiwz.midukanshu.com/wz/dice/index?' + bodyVal - const url = { - url: dice_index_urlVal, - headers: headerVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_index - response: ${JSON.stringify(response)}`) - signinfo.dice_index = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `骰子信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_index - 骰子信息失败: ${e}`) - senku.log(`❌ ${cookieName} dice_index - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 掷骰子 -function dice_roll() { - return new Promise((resolve, reject) => { - const dice_roll_urlVal = 'https://apiwz.midukanshu.com/wz/dice/roll?' + bodyVal - const url = { - url: dice_roll_urlVal, - headers: headerVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(response)}`) - if (JSON.parse(data).code == 0) { - signinfo.rollList.push(JSON.parse(data)) - } - resolve() - } catch (e) { - senku.msg(cookieName, `掷骰子: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_roll - 掷骰子失败: ${e}`) - senku.log(`❌ ${cookieName} dice_roll - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 骰子双倍奖励 -function dice_double() { - return new Promise((resolve, reject) => { - const dice_double_urlVal = 'https://apiwz.midukanshu.com/wz/dice/doubleReward?' + bodyVal - const url = { - url: dice_double_urlVal, - headers: headerVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(response)}`) - if (JSON.parse(data).code == 0) { - signinfo.doubleList.push(JSON.parse(data)) - } - resolve() - } catch (e) { - senku.msg(cookieName, `骰子双倍奖励: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_double - 骰子双倍奖励失败: ${e}`) - senku.log(`❌ ${cookieName} dice_double - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 获取骰子次数 -function dice_addnum() { - return new Promise((resolve, reject) => { - const dice_addnum_urlVal = 'https://apiwz.midukanshu.com/wz/dice/addChangeNumByRewardVideo?' + bodyVal - const url = { - url: dice_addnum_urlVal, - headers: headerVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_4_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 miduapp qapp' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} dice_addnum - response: ${JSON.stringify(response)}`) - if (JSON.parse(data).code == 0) { - signinfo.addnumList.push(JSON.parse(data)) - } - resolve() - } catch (e) { - senku.msg(cookieName, `获取骰子次数: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} dice_addnum - 获取骰子次数失败: ${e}`) - senku.log(`❌ ${cookieName} dice_addnum - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 每日签到 -function signDay() { - return new Promise((resolve, reject) => { - const signurlVal = 'https://apiwz.midukanshu.com/wz/task/signInV2?' + bodyVal - const url = { - url: signurlVal, - headers: headerVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(response)}`) - signinfo.signDay = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signDay - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 签到视频奖励 -function signVideo() { - return new Promise((resolve, reject) => { - const signVideourlVal = 'https://apiwz.midukanshu.com/wz/task/signVideoReward?' + bodyVal - const url = { - url: signVideourlVal, - headers: headerVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.post(url, (error, response, data) => { - try { - senku.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(response)}`) - signinfo.signVideo = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `签到视频: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signVideo - 签到视频失败: ${e}`) - senku.log(`❌ ${cookieName} signVideo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - - -function showmsg() { - let subTitle = '' - let detail = '' - const name = signinfo.userInfo.data.nickname ? signinfo.userInfo.data.nickname : `未设置昵称` - // 签到信息 - if (signinfo.signDay && signinfo.signDay.code == 0) { - if (signinfo.signDay.data) { - const amount = signinfo.signDay.data.amount - amount ? detail += `【签到奖励】获得${amount}💰\n` : detail += `【签到奖励】已获取过奖励\n` - } - } else subTitle += '签到:失败' - - if (signinfo.signVideo && signinfo.signVideo.code == 0) { - const amount = signinfo.signVideo.data.amount - amount ? detail += `【签到视频】获得${amount}💰\n` : detail += `【签到视频】已获取过奖励\n` - } else subTitle += '签到视频:失败' - - // 骰子信息 - // 次数 - if (signinfo.addnumList.length > 0) { - detail += `【骰子次数】增加${signinfo.addnumList.length}次\n` - } else { - detail += `【骰子次数】无次数增加\n` - } - // 掷骰子 - if (signinfo.rollList.length > 0) { - let i = 0 - for (const roll of signinfo.rollList) { - i += 1 - roll.code == 0 ? detail += `【骰子奖励】第${i}次${roll.data.roll_coin}💰\n` : detail += `【骰子奖励】已获取过奖励\n` - } - } else { - detail += `【骰子奖励】无次数掷骰子\n` - } - senku.msg(cookieName + ` 用户:${name}`, subTitle, detail) -} - -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, resp.body)) - } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) - } - } - done = (value = {}) => { - $done(value) - } - return { - isSurge, - isQuanX, - msg, - log, - getdata, - setdata, - get, - post, - done - } -} -""" -print(js) -clipboard.set(js) -console.hud_alert('Copyed!') diff --git a/qtt/.DS_Store b/qtt/.DS_Store deleted file mode 100644 index 51f38aef638a75bc414b5054de04377358f5747a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyG{c!5FA55?iEe_*0ZK|upQfI=#iC_+Gg9pA!N!t4W-5LkH-^&`q<|EV0#ZN*WlCLjVWXiqH1ysy(x=CH8?%XWr>V9Ry4lnH2a71wH@ 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 - -> QuanX 需要: v1.0.6-build195 及以后版本 (TestFlight) - -> 感谢 [@GideonSenku](https://github.com/GideonSenku) Commit - -> 2020.04.07 添加签到脚本 - -> 2020.04.08 添加视频广告奖励、添加每时段签到奖励 - -> 2020.04.09 添加幸运转盘抽奖 - -> 2020.04.13 简化Cookie获取方式 - -> 2020.04.14 添加阅读篇数,添加首页金币奖励,优化通知 - -> 2020.04.16 阅读篇数奖励自动获取 - -> 2020.04.19 添加睡觉领金币 - -> 2020.04.22 添加幸运转盘额外奖励 -## 配置 (Surge) - -```properties -[MITM] -api.1sapp.com - -[Script] -http-request ^https:\/\/api\.1sapp\.com\/sign\/info? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -http-request ^https:\/\/api\.1sapp\.com\/content\/readV2? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -http-request ^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js - -cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.js -``` - -## 配置 (QuanX) - -```properties -[MITM] -api.1sapp.com - -[rewrite_local] - -# [商店版] QuanX v1.0.6-build194 及更早版本 -^https:\/\/api\.1sapp\.com\/sign\/info? url script-request-header qtt.cookie.js -^https:\/\/api\.1sapp\.com\/content\/readV2? url script-request-header qtt.cookie.js -^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header qtt.cookie.js -# [TestFlight] QuanX v1.0.6-build195 及以后版本 -^https:\/\/api\.1sapp\.com\/sign\/info? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -^https:\/\/api\.1sapp\.com\/content\/readV2? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js - -[task_local] -1 0 * * * qtt.js -``` - -## 说明 - -1. 先把`api.1sapp.com`加到`[MITM]` -2. 再配置重写规则: - - Surge: 把两条远程脚本放到`[Script]` - - QuanX: 把`qtt.cookie.js`和`qtt.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) -3. 打开 APP 进入签到: `右上角` > `签到` -4. 系统提示: `获取Cookie: 成功` -5. 把获取 Cookie 的脚本注释掉 -6. 运行一次脚本, 如果提示重复签到, 那就算成功了! -7. 建议将`task`执行次数改成每小时执行防止错过奖励 -8. 阅读篇数获取Cookie:`小视频`中播放一段时间视频即可获取,具体的阅读篇数奖励请到应用内手动点击 -9. 首页金币奖励:此Cookie在首页的推荐中随机出现,随机获取,并不一定会出现。 -10. 其他问题请看日志报错,日志提示权限错误代表cookie失效 -11. 幸运转盘达到次数可自己手动去获取累计奖励,有机率每周五脚本能够再帮你获取一回奖励 -12. 赞赏:趣头条邀请码`A1040276307`,农妇山泉 -> 有点咸 -> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. - -> 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. - -## 常见问题 - -1. 无法写入 Cookie - - - 检查 Surge 系统通知权限放开了没 - - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) - -2. 写入 Cookie 成功, 但签到不成功 - - - 看看是不是在登录前就写入 Cookie 了 - - 如果是,请确保在登录成功后,再尝试写入 Cookie - -3. 为什么有时成功有时失败 - - - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) - - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): - - - `Surge`配置: - - ```properties - # 没有什么是一顿饭解决不了的: - cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 - # 如果有,那就两顿: - cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 - # 实在不行,三顿也能接受: - cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 - - # 再粗暴点,直接: - cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 - ``` - - - `QuanX`配置: - - ```properties - [task_local] - 1 0 * * * xxx.js # 每天00:01执行一次 - 2 0 * * * xxx.js # 每天00:02执行一次 - 3 0 * * * xxx.js # 每天00:03执行一次 - - */60 * * * * xxx.js # 每60分执行一次 - ``` - -## 感谢 - -[@NobyDa](https://github.com/NobyDa) - -[@lhie1](https://github.com/lhie1) - -[@ConnersHua](https://github.com/ConnersHua) - -[@GideonSenku](https://github.com/GideonSenku) diff --git a/qtt/qtt.cookie.js b/qtt/qtt.cookie.js deleted file mode 100644 index 84d3637ddc7e..000000000000 --- a/qtt/qtt.cookie.js +++ /dev/null @@ -1,93 +0,0 @@ -const cookieName = '趣头条' -const signKey = 'senku_signKey_qtt' -const signXTKKey = 'senku_signXTK_qtt' -const readKey = 'senku_readKey_qtt' -const navCoinKey = 'senku_navCoinKey_qtt' -const senku = init() - -const requrl = $request.url -if ($request && $request.method != 'OPTIONS') { - try { - const tokenVal = '&' + requrl.match(/token=[a-zA-Z0-9_-]+/)[0] - const uuidVal = '&' + requrl.match(/uuid=[a-zA-Z0-9_-]+/)[0] - const signVal = tokenVal + uuidVal - const XTK = requrl.match(/tk=[a-zA-Z0-9_-]+/)[0] - const signXTKVal = XTK.substring(3, XTK.length) - if (signVal) senku.setdata(signVal, signKey) - if (signXTKVal) senku.setdata(signXTKVal, signXTKKey) - senku.msg(cookieName, `签到,获取Cookie: 成功`, ``) - senku.log(`🔔${signVal},🔔${signXTKVal}`) - } catch (error) { - senku.log(`❌error:${error}`) - } -} - -if ($request && $request.method != 'OPTIONS' && requrl.match(/\/content\/readV2\?qdata=[a-zA-Z0-9_-]+/)) { - try { - const readVal = requrl - if (readVal) { - if (senku.setdata(readVal, readKey)) - senku.msg(cookieName, `阅读,获取Cookie: 成功`, ``) - senku.log(`🔔${readVal}`) - } - } catch (error) { - senku.log(`❌error:${error}`) - } -} - -if ($request && $request.method != 'OPTIONS' && requrl.match(/\/x\/feed\/getReward\?qdata=[a-zA-Z0-9_-]+/)) { - try { - const navCoinVal = requrl - if (navCoinVal) { - if (senku.setdata(navCoinVal, navCoinKey)) - senku.msg(cookieName, `首页金币奖励,获取Cookie: 成功`, ``) - senku.log(`🔔${navCoinVal}`) - } - } catch (error) { - senku.log(`❌error:${error}`) - } -} -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() diff --git a/qtt/qtt.js b/qtt/qtt.js deleted file mode 100644 index f5b3098fcbc9..000000000000 --- a/qtt/qtt.js +++ /dev/null @@ -1,893 +0,0 @@ -// 赞赏:趣头条邀请码`A1040276307`,农妇山泉 -> 有点咸 -const cookieName = '趣头条' -const signKey = 'senku_signKey_qtt' -const signXTKKey = 'senku_signXTK_qtt' -const readKey = 'senku_readKey_qtt' -const navCoinKey = 'senku_navCoinKey_qtt' -const senku = init() -const signVal = senku.getdata(signKey) -const signXTKVal = senku.getdata(signXTKKey) -const readVal = senku.getdata(readKey) -const navCoinVal = senku.getdata(navCoinKey) -const vsign = 'version=30967000&xhi=200' + signVal -const signurlVal = 'https://api.1sapp.com/sign/sign?' + vsign -const adUrl = 'https://api.1sapp.com/sign/adDone?' + vsign -const getinfoUrlVal = 'https://api.1sapp.com/sign/info?' + vsign -const hourUrlVal = 'https://api.1sapp.com/mission/intPointReward?' + vsign -const coinUrlVal = 'https://api.1sapp.com/app/ioscoin/getInfo?' + vsign -const readReawardVal = 'https://api.1sapp.com/app/ioscoin/readReward?type=content_config&' + vsign -const sleepUrlVal = 'https://mvp-sleeper.qutoutiao.net/v1/sleep/update?status=1&' + vsign -const sleepRewardVal = 'https://mvp-sleeper.qutoutiao.net/v1/reward?which=2&' + vsign -const sleepBagVal = 'https://mvp-sleeper.qutoutiao.net/v1/reward?which=3&' + vsign -const sleepStatusVal = 'https://mvp-sleeper.qutoutiao.net/v1/sleep/status?' + vsign -const luckyUrlVal = 'https://qtt-turntable.qutoutiao.net/press_trigger?' + vsign -const luckyRewardVal = 'https://qtt-turntable.qutoutiao.net/extra_reward?' + vsign -const raindropVal = 'https://work-for-coin.1sapp.com/raindrop/v1/click?sub_id=2&type=2&scene_id=2&' + vsign -const loginVal = 'https://api.1sapp.com/app/user/info/member/v1/get?' + vsign -const sleepNightVal = 'https://cj-activity.1sapp.com/v1/zfb/sleep/coin?from=pm&' + vsign -const sleepMorningVal = 'https://cj-activity.1sapp.com/v1/zfb/sleep/coin?from=am&' + vsign -const sleepinitVal = 'https://api.1sapp.com/dlc/ali/zfbSleepInit?' + vsign -const signinfo = { - playList: [], - luckyList: [], - rainList: [] -} - -; -(sign = async () => { - senku.log(`🔔 ${cookieName}`) - await login() - if (navCoinVal != undefined && navCoinVal.match(/\/x\/feed\/getReward\?qdata=[a-zA-Z0-9_-]+/)) { - await navCoin() - } - if (readVal != undefined && readVal.match(/\/content\/readV2\?qdata=[a-zA-Z0-9_-]+/)) { - await read() - await getcoininfo() - await getreadReward() - } - if (new Date().getHours() == 20 || new Date().getHours() == 12) { - await sleepStatus() - await sleepReward() - await sleep() - if (signinfo.sleepStatus.data.fortune_bag_can_reward) { - await sleepBag() - } - } - if (new Date().getHours() >= 20) { - await sleepinit() - await sleepNight() - } - if (new Date().getHours() >= 5 && new Date().getHours() <= 9) { - await sleepinit() - await sleepMorning() - } - if (new Date().getHours() == 8 || new Date().getHours() == 14) { - await sleepReward() - } - await rain(0) - await rain(1) - await rain(2) - if (new Date().getDay() == 5) { - await luckyReward(3) - await luckyReward(8) - await luckyReward(15) - await luckyReward(20) - await luckyReward(30) - } - await signDay() - await signHour() - await signLucky() - await playone() - await playtwo() - await playthree() - await playfour() - await getinfo() - showmsg() - senku.done() -})().catch((e) => senku.log(`❌ ${cookieName} 签到失败: ${e}`), senku.done()) - -// 每日登录 -function login() { - return new Promise((resolve, reject) => { - const url = { - url: loginVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} login- response: ${JSON.stringify(response)}`) - signinfo.login = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `登录结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signDay - 登录失败: ${e}`) - senku.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// -function sleepinit() { - return new Promise((resolve, reject) => { - const url = { - url: sleepinitVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - resolve() - } catch (e) { - senku.msg(cookieName, `睡觉初始化结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} sleepinit - 睡觉初始化失败: ${e}`) - senku.log(`❌ ${cookieName} sleepinit - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} -// 睡觉 -function sleep() { - return new Promise((resolve, reject) => { - const url = { - url: sleepUrlVal, - headers: { - 'Host': 'mvp-sleeper.qutoutiao.net', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} sleep - response: ${JSON.stringify(response)}`) - signinfo.sleep = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `睡觉结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} sleep - 睡觉失败: ${e}`) - senku.log(`❌ ${cookieName} sleep - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} -// 早睡 -function sleepNight() { - return new Promise((resolve, reject) => { - const url = { - url: sleepNightVal, - headers: { - 'Host': 'cj-activity.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} sleepNight - response: ${JSON.stringify(response)}`) - signinfo.sleepNight = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `早睡结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} sleepNight - 早睡失败: ${e}`) - senku.log(`❌ ${cookieName} sleepNight - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} -// 早起 -function sleepMorning() { - return new Promise((resolve, reject) => { - const url = { - url: sleepMorningVal, - headers: { - 'Host': 'cj-activity.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} sleepMorning - response: ${JSON.stringify(response)}`) - signinfo.sleepMorning = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `早起结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} sleepMorning - 早起失败: ${e}`) - senku.log(`❌ ${cookieName} sleepMorning - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} -// 睡觉金币 -function sleepReward() { - return new Promise((resolve, reject) => { - const url = { - url: sleepRewardVal, - headers: { - 'Host': 'mvp-sleeper.qutoutiao.net', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} sleepReward - response: ${JSON.stringify(response)}`) - signinfo.sleepReward = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `睡觉结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} sleepReward - 睡觉失败: ${e}`) - senku.log(`❌ ${cookieName} sleepReward - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 睡觉福袋 -function sleepBag() { - return new Promise((resolve, reject) => { - const url = { - url: sleepBagVal, - headers: { - 'Host': 'mvp-sleeper.qutoutiao.net', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} sleepBag - response: ${JSON.stringify(response)}`) - signinfo.sleepBag = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `睡觉福袋: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} sleepBag - 睡觉福袋: ${e}`) - senku.log(`❌ ${cookieName} sleepBag - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 睡觉信息 -function sleepStatus() { - return new Promise((resolve, reject) => { - const url = { - url: sleepStatusVal, - headers: { - 'Host': 'mvp-sleeper.qutoutiao.net', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} sleepStatus - response: ${JSON.stringify(response)}`) - signinfo.sleepStatus = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `睡觉信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} sleepStatus - 睡觉信息: ${e}`) - senku.log(`❌ ${cookieName} sleepStatus - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 雨滴金币 -function rain(seri_num) { - return new Promise((resolve, reject) => { - const raindropUrl = raindropVal + '&serial_number=' + seri_num - const url = { - url: raindropUrl, - headers: { - 'Host': 'work-for-coin.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} rain - response: ${JSON.stringify(response)}`) - signinfo.rainList.push(JSON.parse(data)) - resolve() - } catch (e) { - senku.msg(cookieName, `雨滴结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} rain - 雨滴失败: ${e}`) - senku.log(`❌ ${cookieName} rain - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 每日签到 -function signDay() { - return new Promise((resolve, reject) => { - const url = { - url: signurlVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} signDay - response: ${JSON.stringify(response)}`) - signinfo.signDay = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signDay - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 首页奖励 -function navCoin() { - return new Promise((resolve, reject) => { - const url = { - url: navCoinVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} navCoin - response: ${JSON.stringify(response)}`) - signinfo.navCoin = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `首页奖励: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} navCoin - 首页奖励失败: ${e}`) - senku.log(`❌ ${cookieName} navCoin - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} -// 阅读部分 -function read() { - return new Promise((resolve, reject) => { - const url = { - url: readVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} read - response: ${JSON.stringify(response)}`) - signinfo.read = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `阅读结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} read - 阅读失败: ${e}`) - senku.log(`❌ ${cookieName} read - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 获取阅读奖励 -function getreadReward() { - return new Promise((resolve, reject) => { - try { - if (signinfo.coininfo.data) { - const read_num = signinfo.coininfo.data.read_num - if (read_num < 5 && read_num >= 1) { - resolve(readReward(1)) - } else if (read_num < 15 && read_num >= 5) { - resolve(readReward(5)) - } else if (read_num < 18 && read_num >= 15) { - resolve(readReward(15)) - } else if (read_num == 18) { - resolve(readReward(18)) - } else resolve() - } - } catch (e) { - senku.msg(cookieName, `获取阅读奖励: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} getreadReward - 获取阅读奖励失败: ${e}`) - resolve() - } - }) -} - -// 阅读奖励请求 -function readReward(reward_id) { - return new Promise((resolve, reject) => { - const readRewardUrl = readReawardVal + '&reward_id=' + reward_id - const url = { - url: readRewardUrl, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} readReward - response: ${JSON.stringify(response)}`) - signinfo.readReward = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `阅读奖励请求: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} readReward - 阅读奖励请求失败: ${e}`) - senku.log(`❌ ${cookieName} readReward - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 获取阅读信息 -function getcoininfo() { - return new Promise((resolve, reject) => { - const url = { - url: coinUrlVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} getcoininfo - response: ${JSON.stringify(response)}`) - signinfo.coininfo = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} getcoininfo - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} getcoininfo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// FIXME: 时段请求偶尔丢失或伪请求 -function signHour() { - return new Promise((resolve, reject) => { - const url = { - url: hourUrlVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} signHour - response: ${JSON.stringify(response)}`) - signinfo.signHour = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `时段签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signHour - 时段签到失败: ${e}`) - senku.log(`❌ ${cookieName} signHour - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -function signLucky() { - return new Promise((resolve, reject) => { - const url = { - url: luckyUrlVal, - headers: { - 'Host': 'qtt-turntable.qutoutiao.net', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} signLucky - response: ${JSON.stringify(response)}`) - signinfo.signLucky = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `幸运转盘: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} signLucky - 幸运转盘失败: ${e}`) - senku.log(`❌ ${cookieName} signLucky - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 幸运转盘额外奖励 -function luckyReward(times) { - return new Promise((resolve, reject) => { - const luckyRewardUrl = luckyRewardVal + '×=' + times - const url = { - url: luckyRewardUrl, - headers: { - 'Host': 'qtt-turntable.qutoutiao.net', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} luckyReward - response: ${JSON.stringify(response)}`) - signinfo.luckyList.push(JSON.parse(data)) - resolve() - } catch (e) { - senku.msg(cookieName, `转盘额外奖励请求: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} luckyReward - 转盘额外奖励请求失败: ${e}`) - senku.log(`❌ ${cookieName} luckyReward - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -// 获取签到信息 -function getinfo() { - return new Promise((resolve, reject) => { - const url = { - url: getinfoUrlVal, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} getinfo - response: ${JSON.stringify(response)}`) - signinfo.info = JSON.parse(data) - resolve() - } catch (e) { - senku.msg(cookieName, `获取信息: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} getinfo - 获取信息失败: ${e}`) - senku.log(`❌ ${cookieName} getinfo - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - - -// 视频广告部分 -function playone() { - return new Promise((resolve, reject) => { - const urlParameter = 'https://api.1sapp.com/sign/adDone?version=30967000&xhi=200&pos=one' + signVal - const url = { - url: urlParameter, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla / 5.0(iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit / 605.1.15(KHTML, like Gecko) Mobile / 15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - signinfo.playList.push(JSON.parse(data)) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} playAd - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -function playtwo() { - return new Promise((resolve, reject) => { - const urlParameter = 'https://api.1sapp.com/sign/adDone?version=30967000&xhi=200&pos=two' + signVal - const url = { - url: urlParameter, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla / 5.0(iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit / 605.1.15(KHTML, like Gecko) Mobile / 15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - signinfo.playList.push(JSON.parse(data)) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} playAd - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -function playthree() { - return new Promise((resolve, reject) => { - const urlParameter = 'https://api.1sapp.com/sign/adDone?version=30967000&xhi=200&pos=three' + signVal - const url = { - url: urlParameter, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla / 5.0(iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit / 605.1.15(KHTML, like Gecko) Mobile / 15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - signinfo.playList.push(JSON.parse(data)) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} playAd - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - -function playfour() { - return new Promise((resolve, reject) => { - const urlParameter = 'https://api.1sapp.com/sign/adDone?version=30967000&xhi=200&pos=four' + signVal - const url = { - url: urlParameter, - headers: { - 'Host': 'api.1sapp.com', - 'X-Tk': signXTKVal - } - } - url.headers['User-Agent'] = 'Mozilla / 5.0(iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit / 605.1.15(KHTML, like Gecko) Mobile / 15E148' - senku.get(url, (error, response, data) => { - try { - senku.log(`❕ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - signinfo.playList.push(JSON.parse(data)) - resolve() - } catch (e) { - senku.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) - senku.log(`❌ ${cookieName} playAd - 签到失败: ${e}`) - senku.log(`❌ ${cookieName} playAd - response: ${JSON.stringify(response)}`) - resolve() - } - }) - }) -} - - -// 将时间戳格式化 -function tTime(timestamp) { - const date = new Date(timestamp * 1000) - const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-' - const D = (date.getDate() + 1 < 10 ? '0' + date.getDate() : date.getDate()) + ' ' - const h = date.getHours() + ':' - const m = (date.getMinutes() + 1 < 10 ? '0' + (date.getMinutes() + 1) : date.getMinutes() + 1) + '' - return M + D + h + m -} - -// 通知信息部分 -function showmsg() { - let subTitle = `` - let detail = `` - const name = signinfo.login.data.nickname ? signinfo.login.data.nickname : `未设置昵称或Cookie失效` - // signDayMsg - if (signinfo.info && signinfo.info.data.signIn.today == 1) { - if (signinfo.signDay.code == 0) { - subTitle += subTitle == `` ? `` : ` ` - const continuation = signinfo.info.data.signIn.continuation - const amount = signinfo.info.data.signIn.amount - const currentCoin = amount[continuation] - const nextCoin = amount[continuation + 1] - const coins = signinfo.info.data.show_balance_info.coins - subTitle += `每日:成功` - detail += `【每日签到】获得${currentCoin}💰,明日可得${nextCoin}💰\n` - } else subTitle += `` - } else { - subTitle += `每日:失败` - senku.log(`❌ ${cookieName} showmsg - 每日签到: ${JSON.stringify(signinfo.signDay)}`) - } - - // signHourMsg - subTitle += subTitle == `` ? `` : ` ` - if (signinfo.signHour && signinfo.signHour.code == 0) { - subTitle += '时段:成功' - const amount = signinfo.signHour.data.amount - const next_time = tTime(signinfo.signHour.data.next_time) - detail += `【时段签到】获得${amount}💰,下次签到:${next_time}\n` - } else subTitle += `时段:时间未到` - - // readMsg - if (signinfo.read && signinfo.read.data.status_code == 0) { - if (signinfo.coininfo.data) { - const desc = signinfo.coininfo.data.content_config.desc - if (signinfo.readReward != undefined && signinfo.readReward.code == 0) { - detail += `【阅读详情】${desc},奖励:成功\n` - } else if (signinfo.readReward != undefined && signinfo.readReward.code == -113) { - signinfo.coininfo.data.read_num == 18 ? detail += `` : detail += `【阅读详情】${desc},已获取阶段奖励\n` - - } else detail += `【阅读详情】${desc},手动获取金币\n` - } - } else detail += `【阅读详情】失败\n` - - // sleepMsg - if (signinfo.sleep && signinfo.sleep.data.success) { - detail += `【睡觉结果】已开始睡觉\n` - } else if (signinfo.sleepReward && signinfo.sleepReward.data) { - if (signinfo.sleepReward.data.success) { - const coins = signinfo.sleepReward.data.coins - coins == 0 ? detail += `` : detail += `【睡觉金币】获得${coins}💰\n` - } else { - detail += `【睡觉金币】金币获取失败\n` - } - } else if (signinfo.sleep == undefined) { - detail += `` - // sleepBagMsg - } else if (signinfo.sleepBag && signinfo.sleepBag.code == 0) { - const coins = signinfo.sleepBag.data.coins - coins == 0 ? detail += `` : detail += `【睡觉福袋】获得${signinfo.sleepBag.data.coins}💰\n` - } else { - detail += `【睡觉结果】失败\n` - } - // 早睡 - if (signinfo.sleepNight && signinfo.sleepNight.code == 0) { - if (signinfo.sleepNight.data && signinfo.sleepNight.data.coin) { - const coin = signinfo.sleepNight.data.coin - coin == 0 ? detail += `` : detail += `【早睡结果】获得${coin}💰\n` - } - } - // 早起 - if (signinfo.sleepMorning && signinfo.sleepMorning.code == 0) { - if (signinfo.sleepMorning.data && signinfo.sleepMorning.data.coin) { - const coin = signinfo.sleepMorning.data.coin - coin == 0 ? detail += `` : detail += `【早起结果】获得${coin}💰\n` - } - } - - // rainDropMsg - if (signinfo.rainList) { - for (const rains of signinfo.rainList) { - 87 - rains.code == 0 ? detail += `【金币雨滴】成功\n` : detail += `` - } - } else { - detail += `【金币雨滴】失败\n` - } - - // navCoinMsg - if (signinfo.navCoin && signinfo.navCoin.code == 0) { - if (signinfo.coininfo.data) { - const cur_amount = signinfo.navCoin.data.cur_amount - const total_times = signinfo.navCoin.data.total_times - const done_times = signinfo.navCoin.data.done_times - done_times == 15 ? detail += `` : detail += `【首页奖励】${cur_amount} 💰, 完成${done_times} /${total_times}\n` - } - } else if (signinfo.navCoin && signinfo.navCoin.code == -308) { - detail += `【首页奖励】时间未到\n` - } else if (signinfo.navCoin && signinfo.navCoin.code == -2) { - detail += `【首页奖励】Cookie失效\n` - } else detail += `【首页奖励】失败或Cookie不存在\n` - - // signLuckyMsg - subTitle += subTitle == '' ? '' : ' ' - if (signinfo.signLucky && signinfo.signLucky.code == 1) { - subTitle += `幸运转盘:成功` - const amount_coin = signinfo.signLucky.amount_coin - const count = signinfo.signLucky.count - const count_limit = signinfo.signLucky.count_limit - detail += `【幸运转盘】获得${amount_coin},抽奖情况:${count}/${count_limit}次\n` - } else subTitle += `` - - // luckyExtraMsg - if (signinfo.luckyList) { - const times = [3, 8, 15, 20, 30] - let i = 0 - for (const extra of signinfo.luckyList) { - if (extra.code == 0) { - detail += `【转盘额外】次数:${times[i]} 获得${extra.reward_coin}💰\n` - } else if (extra.code == -2) { - detail += `【转盘额外】次数:${times[i]} 重复领取\n` - } else if (extra.code == -1) { - detail += `【转盘额外】次数:${times[i]} 当前次数未达到\n` - } else detail += `【转盘额外】未知错误\n` - i += 1 - } - } else detail += `【转盘额外】失败` - - // playAdsMsg - subTitle += subTitle == '' ? '' : ' ' - if (signinfo.playList) { - if (signinfo.playList[0].code == 0) { - const icon = signinfo.info.data.signIn.ext_ad.icon - const coins = signinfo.info.data.show_balance_info.coins - const continuation = signinfo.info.data.signIn.continuation - for (const poss of icon) { - if (poss.next_time > 0) { - const time = tTime(poss.next_time) - detail += `【视频广告】下次🕥${time} 可获得${poss.amount}💰\n` - } - } - detail += `【账户详情】共计:${coins}💰,连续签到${continuation}天` - } else if (signinfo.playList[0].code == -126) subTitle += `广告:权限错误` - } else subTitle += `广告:失败` - - senku.msg(cookieName + ` 用户:${name}`, subTitle, detail) - senku.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, resp.body)) - } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) - } - } - done = (value = {}) => { - $done(value) - } - return { - isSurge, - isQuanX, - msg, - log, - getdata, - setdata, - get, - post, - done - } -} \ No newline at end of file diff --git a/surge.cookies.sgmodule b/surge.cookies.sgmodule index 08ef74e6d791..59305a15b80c 100644 --- a/surge.cookies.sgmodule +++ b/surge.cookies.sgmodule @@ -31,16 +31,12 @@ Rewrite: 京东到家 = type=http-request,pattern=^https:\/\/daojia.jd.com/clien Rewrite: 加油广东 = type=http-request,pattern=^https:\/\/m.gdoil.cn\/webapi\/usersign\/addusersign,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.cookie.js Rewrite: 猫咪音乐网 = type=http-request,pattern=https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/maomicd/maomicd.cookie.js Rewrite: 米游社 = type=http-request,pattern=^https:\/\/api-takumi.mihoyo.com\/apihub\/api\/getGameList,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mihoyo/mihoyo.cookie.js -Rewrite: 米读 = type=http-request,pattern=^https:\/\/apiwz\.midukanshu\.com,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/midu/midu.cookie.js,requires-body=true Rewrite: 美团 = type=http-request,pattern=^https:\/\/i.meituan.com\/evolve\/signin\/signpost\/,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.cookie.js,requires-body=true Rewrite: 美团外卖 = type=http-request,pattern=^https:\/\/promotion.waimai.meituan.com\/playcenter\/signIn\/doaction url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js Rewrite: 美团外卖 = type=http-request,pattern=^https:\/\/promotion.waimai.meituan.com\/playcenter\/signIn\/entry,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js 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\.1sapp\.com\/content\/readV2?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -Rewrite: 趣头条 = type=http-request,pattern=^https:\/\/api\.1sapp\.com\/sign\/info?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js -Rewrite: 趣头条 = type=http-request,pattern=^https:\/\/api\.1sapp\.com\/x\/feed\/getReward?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.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 From 4a828a7a8cdbf5014548679f6040bd2dc606adc1 Mon Sep 17 00:00:00 2001 From: dukecd33369 Date: Mon, 26 Jul 2021 23:33:17 +0800 Subject: [PATCH 08/19] Update Env.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决Node.js环境下非UTF-8编码问题 --- Env.js | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/Env.js b/Env.js index 168612abf0a1..fef799cdb69d 100644 --- a/Env.js +++ b/Env.js @@ -37,6 +37,7 @@ function Env(name, opts) { this.isMute = false this.isNeedRewrite = false this.logSeparator = '\n' + this.encoding = 'utf-8' this.startTime = new Date().getTime() Object.assign(this, opts) this.log('', `🔔${this.name}, 开始!`) @@ -290,6 +291,7 @@ function Env(name, opts) { (err) => callback(err) ) } else if (this.isNode()) { + let iconv = require('iconv-lite') this.initGotEnv(opts) this.got(opts) .on('redirect', (resp, nextOpts) => { @@ -308,12 +310,22 @@ function Env(name, opts) { }) .then( (resp) => { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) + if (this.encoding !== 'utf-8') { + const { statusCode: status, statusCode, headers, rawBody } = resp + callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) + } else { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + } }, (err) => { - const { message: error, response: resp } = err - callback(error, resp, resp && resp.body) + if (this.encoding !== 'utf-8') { + const { message: error, response: resp } = err + callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) + } else { + const { message: error, response: resp } = err + callback(error, resp, resp && resp.body) + } } ) } @@ -352,16 +364,27 @@ function Env(name, opts) { (err) => callback(err) ) } else if (this.isNode()) { + let iconv = require('iconv-lite') this.initGotEnv(opts) const { url, ..._opts } = opts this.got[method](url, _opts).then( (resp) => { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) + if (this.encoding !== 'utf-8') { + const { statusCode: status, statusCode, headers, rawBody } = resp + callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) + } else { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + } }, (err) => { - const { message: error, response: resp } = err - callback(error, resp, resp && resp.body) + if (this.encoding !== 'utf-8') { + const { message: error, response: resp } = err + callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) + } else { + const { message: error, response: resp } = err + callback(error, resp, resp && resp.body) + } } ) } From 34e5f4e7b7056702f408acc3ad0d6184938bc223 Mon Sep 17 00:00:00 2001 From: dukecd33369 Date: Mon, 26 Jul 2021 23:50:35 +0800 Subject: [PATCH 09/19] Update Env.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决Node.js环境下非UTF-8编码问题 如:Node.js环境下设置this.encoding = 'GBK'即可 --- Env.js | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/Env.js b/Env.js index fef799cdb69d..ffd4fb2de43b 100644 --- a/Env.js +++ b/Env.js @@ -310,22 +310,12 @@ function Env(name, opts) { }) .then( (resp) => { - if (this.encoding !== 'utf-8') { - const { statusCode: status, statusCode, headers, rawBody } = resp - callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) - } else { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) - } + const { statusCode: status, statusCode, headers, rawBody } = resp + callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) }, (err) => { - if (this.encoding !== 'utf-8') { - const { message: error, response: resp } = err - callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) - } else { - const { message: error, response: resp } = err - callback(error, resp, resp && resp.body) - } + const { message: error, response: resp } = err + callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) } ) } @@ -369,22 +359,12 @@ function Env(name, opts) { const { url, ..._opts } = opts this.got[method](url, _opts).then( (resp) => { - if (this.encoding !== 'utf-8') { - const { statusCode: status, statusCode, headers, rawBody } = resp - callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) - } else { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) - } + const { statusCode: status, statusCode, headers, rawBody } = resp + callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) }, (err) => { - if (this.encoding !== 'utf-8') { - const { message: error, response: resp } = err - callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) - } else { - const { message: error, response: resp } = err - callback(error, resp, resp && resp.body) - } + const { message: error, response: resp } = err + callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) } ) } From 0f1673123daa0aa5c8d04f873bde7c1faaac829d Mon Sep 17 00:00:00 2001 From: dukecd33369 Date: Tue, 27 Jul 2021 02:42:09 +0800 Subject: [PATCH 10/19] Update Env.min.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决Node.js环境下非UTF-8编码问题 如:Node.js环境下设置this.encoding = 'GBK'即可 --- Env.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Env.min.js b/Env.min.js index ee1c79fa9e41..e55b40fd2711 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;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}isShadowrocket(){return"undefined"!=typeof $rocket}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=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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: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:i,...r}=t;this.got[s](i,r).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,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}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 +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.encoding="utf-8",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}isShadowrocket(){return"undefined"!=typeof $rocket}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()&&(c=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:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(p,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))}))}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){let c=require('iconv-lite');this.initGotEnv(t);const{url:i,...r}=t;this.got[s](i,r).then(t=>{const{statusCode:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(o,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))})}}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}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)} From e9d37a10626ff58c9f443ab1c8ff3ccb5d6a72d8 Mon Sep 17 00:00:00 2001 From: dukecd33369 Date: Tue, 27 Jul 2021 02:58:14 +0800 Subject: [PATCH 11/19] Update Env.min.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决Node.js环境下非UTF-8编码问题 如:Node.js环境下设置this.encoding = 'GBK'即可 --- Env.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Env.min.js b/Env.min.js index e55b40fd2711..f25912dd6a37 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;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.encoding="utf-8",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}isShadowrocket(){return"undefined"!=typeof $rocket}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()&&(c=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:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(p,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))}))}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){let c=require('iconv-lite');this.initGotEnv(t);const{url:i,...r}=t;this.got[s](i,r).then(t=>{const{statusCode:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(o,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))})}}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}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)} +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.encoding="utf-8",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}isShadowrocket(){return"undefined"!=typeof $rocket}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=>{let c=require('iconv-lite');const{statusCode:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(o,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))}))}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){let c=require('iconv-lite');this.initGotEnv(t);const{url:i,...r}=t;this.got[s](i,r).then(t=>{const{statusCode:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(o,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))})}}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}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)} From 46b8d8f55c962cd282e9ca197edcb243709f63af Mon Sep 17 00:00:00 2001 From: Chavy Date: Tue, 27 Jul 2021 09:00:45 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0[EnvJs]:=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Env.js | 8 ++++---- Env.min.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Env.js b/Env.js index ffd4fb2de43b..d261075eb0fb 100644 --- a/Env.js +++ b/Env.js @@ -311,11 +311,11 @@ function Env(name, opts) { .then( (resp) => { const { statusCode: status, statusCode, headers, rawBody } = resp - callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) + callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody, this.encoding)) }, (err) => { const { message: error, response: resp } = err - callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) + callback(error, resp, resp && iconv.decode(resp.rawBody, this.encoding)) } ) } @@ -360,11 +360,11 @@ function Env(name, opts) { this.got[method](url, _opts).then( (resp) => { const { statusCode: status, statusCode, headers, rawBody } = resp - callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody,this.encoding)) + callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody, this.encoding)) }, (err) => { const { message: error, response: resp } = err - callback(error, resp, resp && iconv.decode(resp.rawBody,this.encoding)) + callback(error, resp, resp && iconv.decode(resp.rawBody, this.encoding)) } ) } diff --git a/Env.min.js b/Env.min.js index f25912dd6a37..ce3db30df0b2 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;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.encoding="utf-8",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}isShadowrocket(){return"undefined"!=typeof $rocket}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=>{let c=require('iconv-lite');const{statusCode:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(o,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))}))}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){let c=require('iconv-lite');this.initGotEnv(t);const{url:i,...r}=t;this.got[s](i,r).then(t=>{const{statusCode:s,statusCode:i,headers:r,rawBody:o}=t;e(null,{status:s,statusCode:i,headers:r,rawBody:o},c.decode(o,this.encoding))},t=>{const{message:s,response:i}=t;e(s,i,i&&c.decode(i.rawBody,this.encoding))})}}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}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)} +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.encoding="utf-8",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}isShadowrocket(){return"undefined"!=typeof $rocket}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("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};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),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=(()=>{})){if(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)});else if(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));else if(this.isNode()){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:r,headers:o,rawBody:h}=t;e(null,{status:i,statusCode:r,headers:o,rawBody:h},s.decode(h,this.encoding))},t=>{const{message:i,response:r}=t;e(i,r,r&&s.decode(r.rawBody,this.encoding))})}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){let i=require("iconv-lite");this.initGotEnv(t);const{url:r,...o}=t;this.got[s](r,o).then(t=>{const{statusCode:s,statusCode:r,headers:o,rawBody:h}=t;e(null,{status:s,statusCode:r,headers:o,rawBody:h},i.decode(h,this.encoding))},t=>{const{message:s,response:r}=t;e(s,r,r&&i.decode(r.rawBody,this.encoding))})}}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}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 ae64eba5b1d86072217a7e53e11956fbe545a078 Mon Sep 17 00:00:00 2001 From: dukecd33369 Date: Fri, 3 Sep 2021 11:54:37 +0800 Subject: [PATCH 13/19] Update feng.js --- feng/feng.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feng/feng.js b/feng/feng.js index 7367287a3cca..732821d9bb59 100644 --- a/feng/feng.js +++ b/feng/feng.js @@ -22,7 +22,7 @@ $.KEY_login = 'chavy_login_feng' function login() { const loginOpts = $.getjson($.KEY_login) const url = { - url: `http://49.234.36.200:9091/v1/auth/signin`, + url: `https://api.wfdata.club/v1/auth/signin`, body: loginOpts['body'], headers: { 'X-Request-Id': encrypt(`url=/v1/auth/signin$time=${new Date().getTime()}`), @@ -37,7 +37,7 @@ function login() { function sign() { const loginOpts = $.getjson($.KEY_login) const url = { - url: `http://49.234.36.200:9091/v1/attendance/userSignIn`, + url: `https://api.wfdata.club/v1/attendance/userSignIn`, body: '', headers: { 'Content-Type': `application/x-www-form-urlencoded`, From 2961e16b002ec62cc878873187ce71c8bd33e74c Mon Sep 17 00:00:00 2001 From: dukecd33369 Date: Fri, 3 Sep 2021 20:51:04 +0800 Subject: [PATCH 14/19] Update README.md --- feng/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/feng/README.md b/feng/README.md index 847bb91deddd..600eb7826d63 100644 --- a/feng/README.md +++ b/feng/README.md @@ -4,10 +4,10 @@ ```properties [MITM] -49.234.36.200:9091 +api.wfdata.club [Script] -Rewrite: feng = type=http-request,pattern=^http:\/\/49.234.36.200:9091\/v1\/auth\/signin,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js,requires-body=true +Rewrite: feng = type=http-request,pattern=^https?:\/\/api.wfdata.club\/v1\/auth\/signin,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js,requires-body=true cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js ``` @@ -15,10 +15,10 @@ cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scr ```properties [MITM] -49.234.36.200:9091 +api.wfdata.club [rewrite_local] -^http:\/\/49.234.36.200:9091\/v1\/auth\/signin url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js +^https?:\/\/api.wfdata.club\/v1\/auth\/signin url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js [task_local] 1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js @@ -28,10 +28,10 @@ cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scr ```properties [MITM] -49.234.36.200:9091 +api.wfdata.club [rewrite_local] -http-request ^http:\/\/49.234.36.200:9091\/v1\/auth\/signin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js, requires-body=true, tag=Rewrite: feng +http-request ^https?:\/\/api.wfdata.club\/v1\/auth\/signin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js, requires-body=true, tag=Rewrite: feng [task_local] cron "1 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js From b5c9e4cf1eec2faa39df5c3507c30d2eedc8a810 Mon Sep 17 00:00:00 2001 From: Chavy Date: Fri, 24 Sep 2021 23:19:45 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0[=E5=96=9C=E9=A9=AC?= =?UTF-8?q?=E6=8B=89=E9=9B=85]:=20=E8=8E=B7=E5=8F=96=20Cookie=20=E6=AD=A3?= =?UTF-8?q?=E5=88=99=E5=8F=8A=20hostname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loon.cookie.conf | 4 ++-- QuantumultX_AppStore_Local_Cookie.conf | 4 ++-- QuantumultX_Local_Cookie.conf | 4 ++-- surge.cookies.sgmodule | 4 ++-- ximalaya/README.md | 13 +++++-------- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Loon.cookie.conf b/Loon.cookie.conf index 42404c182528..6f276c45b1f9 100644 --- a/Loon.cookie.conf +++ b/Loon.cookie.conf @@ -9,7 +9,7 @@ http-request ^https:\/\/access.video.qq.com\/user\/auth_refresh script-path=http 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?:\/\/.*\/mobile\-user\/homePage\/.* script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js,tag=喜马拉雅 +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:\/\/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=顺丰速运 @@ -66,4 +66,4 @@ http-response ^https:\/\/my\.ruanmei\.com\/api\/usersign\/getsigninfo? script-pa 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=智行火车票 -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, mobwsa.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.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 diff --git a/QuantumultX_AppStore_Local_Cookie.conf b/QuantumultX_AppStore_Local_Cookie.conf index 4db89c737f99..5e2457b6f79a 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, mobwsa.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.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 # 电信营业厅 ^https:\/\/wapside.189.cn:9001\/api\/home\/sign url script-request-body chavyleung/10000/10000.cookie.js @@ -57,7 +57,7 @@ hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning ^https:\/\/access.video.qq.com\/user\/auth_refresh url script-request-header chavyleung/videoqq/videoqq.cookie.js # 喜马拉雅 -^https?:\/\/.*\/mobile\-user\/homePage\/.* url script-request-header chavyleung/ximalaya/ximalaya.cookie.js +^https?:\/\/.*\/mobile\-user\/(v1\/)?homePage\/.* url script-request-header chavyleung/ximalaya/ximalaya.cookie.js # 网易严选 # ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json url script-request-header chavyleung/yanxuan/yanxuan.cookie.js diff --git a/QuantumultX_Local_Cookie.conf b/QuantumultX_Local_Cookie.conf index 989e9d917e06..9890969be2d0 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, mobwsa.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.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 # 电信营业厅 ^https:\/\/wapside.189.cn:9001\/api\/home\/sign url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js @@ -57,7 +57,7 @@ hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning ^https:\/\/access.video.qq.com\/user\/auth_refresh url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/videoqq/videoqq.cookie.js # 喜马拉雅 -^https?:\/\/.*\/mobile\-user\/homePage\/.* url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js +^https?:\/\/.*\/mobile\-user\/(v1\/)?homePage\/.* url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js # 网易严选 # ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/yanxuan/yanxuan.cookie.js diff --git a/surge.cookies.sgmodule b/surge.cookies.sgmodule index 59305a15b80c..3129966358d9 100644 --- a/surge.cookies.sgmodule +++ b/surge.cookies.sgmodule @@ -50,10 +50,10 @@ Rewrite: 腾讯视频 = type=http-request,pattern=^https:\/\/access.video.qq.com Rewrite: 网易新闻 = type=http-request,pattern=^https:\/\/(.*?)c\.m\.163\.com\/uc\/api\/sign\/v3\/commit,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasenews/neteasenews.cookie.js,requires-body=true 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\/homePage\/.*,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.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\.ctrip\.com/restapi/soa2/14593/json/attendanceDay?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js,requires-body=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, mobwsa.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.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 diff --git a/ximalaya/README.md b/ximalaya/README.md index 50d336564cd2..414d3a994233 100644 --- a/ximalaya/README.md +++ b/ximalaya/README.md @@ -14,10 +14,10 @@ ```properties [MITM] -mobwsa.ximalaya.com +113.96.156.178, *.ximalaya.com [Script] -http-request ^https?:\/\/.*\/mobile\-user\/homePage\/.* script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js +http-request ^https?:\/\/.*\/mobile\-user\/(v1\/)?homePage\/.* script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.js ``` @@ -25,13 +25,10 @@ cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scr ```properties [MITM] -mobwsa.ximalaya.com +113.96.156.178, *.ximalaya.com [rewrite_local] -# 189及以前版本 -^https?:\/\/.*\/mobile\-user\/homePage\/.* url script-response-body ximalaya.cookie.js -# 190及以后版本 -^https?:\/\/.*\/mobile\-user\/homePage\/.* url script-request-header ximalaya.cookie.js +^https?:\/\/.*\/mobile\-user\/(v1\/)?homePage\/.* url script-request-header ximalaya.cookie.js [task_local] 1 0 * * * ximalaya.js @@ -39,7 +36,7 @@ mobwsa.ximalaya.com ## 说明 -1. 先把`mobwsa.ximalaya.com`加到`[MITM]` +1. 先把`113.96.156.178, *.ximalaya.com`加到`[MITM]` 2. 再配置重写规则: - Surge: 把两条远程脚本放到`[Script]` - QuanX: 把`ximalaya.cookie.js`和`ximalaya.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) From 1f527f384f251c6e4496507406ac59bb80643d11 Mon Sep 17 00:00:00 2001 From: HarryWang29 Date: Mon, 27 Sep 2021 19:45:43 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=B5=E4=BF=A1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 10000/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10000/README.md b/10000/README.md index a5e38de2f81d..bda7e8449d35 100644 --- a/10000/README.md +++ b/10000/README.md @@ -10,7 +10,7 @@ wapside.189.cn:9001 [Script] -http-request ^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js, requires-body=true +http-request ^https:\/\/wapside.189.cn:9001\/jt-sign\/api\/home\/homeInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js, requires-body=true cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.js ``` From e97dab84216e77cefc9160d629c3e4a3486aea20 Mon Sep 17 00:00:00 2001 From: HarryWang29 Date: Mon, 27 Sep 2021 20:04:56 +0800 Subject: [PATCH 17/19] Update chavy.boxjs.json --- box/chavy.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/box/chavy.boxjs.json b/box/chavy.boxjs.json index c6673526c1ee..82dc0a67b885 100644 --- a/box/chavy.boxjs.json +++ b/box/chavy.boxjs.json @@ -8,7 +8,7 @@ { "id": "10000", "name": "10000", - "keys": [], + "keys": ["chavy_signheader_10000"], "settings": [ { "id": "chavy_mobile_10000", From 48534c94725a06c28031789a44ed1a96166896c0 Mon Sep 17 00:00:00 2001 From: id77 <9592236+id77@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:03:52 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=20=E6=9B=B4=E6=96=B0[EnvJs]:=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81QX=E7=82=B9=E5=87=BB=E9=80=9A=E7=9F=A5=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E8=AE=BE=E5=AE=9A=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Env.js | 4 +++- Env.min.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Env.js b/Env.js index d261075eb0fb..d58779f428a2 100644 --- a/Env.js +++ b/Env.js @@ -429,7 +429,9 @@ function Env(name, opts) { } else if (this.isQuanX()) { let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl - return { 'open-url': openUrl, 'media-url': mediaUrl } + let updatePasteboard = + rawOpts['update-pasteboard'] || rawOpts.updatePasteboard + return { 'open-url': openUrl, 'media-url': mediaUrl, 'update-pasteboard': updatePasteboard } } else if (this.isSurge()) { let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url'] return { url: openUrl } diff --git a/Env.min.js b/Env.min.js index ce3db30df0b2..10126c782060 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;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.encoding="utf-8",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}isShadowrocket(){return"undefined"!=typeof $rocket}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("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};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),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=(()=>{})){if(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)});else if(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));else if(this.isNode()){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:r,headers:o,rawBody:h}=t;e(null,{status:i,statusCode:r,headers:o,rawBody:h},s.decode(h,this.encoding))},t=>{const{message:i,response:r}=t;e(i,r,r&&s.decode(r.rawBody,this.encoding))})}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){let i=require("iconv-lite");this.initGotEnv(t);const{url:r,...o}=t;this.got[s](r,o).then(t=>{const{statusCode:s,statusCode:r,headers:o,rawBody:h}=t;e(null,{status:s,statusCode:r,headers:o,rawBody:h},i.decode(h,this.encoding))},t=>{const{message:s,response:r}=t;e(s,r,r&&i.decode(r.rawBody,this.encoding))})}}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}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 +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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}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}isShadowrocket(){return"undefined"!=typeof $rocket}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=(()=>{})){if(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)});else if(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));else if(this.isNode()){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:r,headers:o,rawBody:h}=t;e(null,{status:i,statusCode:r,headers:o,rawBody:h},s.decode(h,this.encoding))},t=>{const{message:i,response:r}=t;e(i,r,r&&s.decode(r.rawBody,this.encoding))})}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";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[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())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:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){let i=require("iconv-lite");this.initGotEnv(t);const{url:r,...o}=t;this.got[s](r,o).then(t=>{const{statusCode:s,statusCode:r,headers:o,rawBody:h}=t;e(null,{status:s,statusCode:r,headers:o,rawBody:h},i.decode(h,this.encoding))},t=>{const{message:s,response:r}=t;e(s,r,r&&i.decode(r.rawBody,this.encoding))})}}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}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,i=rawOpts["update-pasteboard"]||rawOpts.updatePasteboard;return{"open-url":e,"media-url":s,"update-pasteboard":i}}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=["","==============📣系统通知📣=============="];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("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} \ No newline at end of file From 35c0e3e3a16b3cb00eca16c1951995311f2b9a66 Mon Sep 17 00:00:00 2001 From: qhq Date: Sat, 4 Dec 2021 14:13:30 +0800 Subject: [PATCH 19/19] Update Env.js --- Env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Env.js b/Env.js index d58779f428a2..f60a092eb099 100644 --- a/Env.js +++ b/Env.js @@ -430,7 +430,7 @@ function Env(name, opts) { let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl let updatePasteboard = - rawOpts['update-pasteboard'] || rawOpts.updatePasteboard + rawopts['update-pasteboard'] || rawopts.updatePasteboard return { 'open-url': openUrl, 'media-url': mediaUrl, 'update-pasteboard': updatePasteboard } } else if (this.isSurge()) { let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url']