├── README.md ├── YaphteS0903.boxjs.json ├── bsxxl.js ├── cgwz.js ├── cyds.js ├── cydxs.js ├── dfhz.js ├── djxs.js ├── dtwz.js ├── elsbjsb.js ├── flg.js ├── flhs.js ├── hhd.js ├── hmd.js ├── image ├── YaphetS.jpg ├── YaphetS.png ├── dfhz.png ├── flg.png ├── flhs.png ├── ls.png ├── ls2.png └── sjb.png ├── kxxxx.js ├── ls.js ├── ppxxx.js ├── qjp.js ├── qxq.js ├── sjb.js ├── ttcg.js ├── ttdt.js ├── ttdz.js ├── ttxfk.js ├── wzxyjkdk.js ├── wzxyrjrb.js ├── ysy.js └── zfxs.js /README.md: -------------------------------------------------------------------------------- 1 | # JStest 2 | 自用 3 | -------------------------------------------------------------------------------- /bsxxl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:宝石消消乐 3 | 更新时间:2021-09-27 @YaphetS0903 4 | 脚本说明:宝石消消乐自动刷红包。。 5 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 6 | 宝石消消乐使用方法: 7 | 领取红包获得红包数据。 8 | 本脚本以学习为主 9 | TG通知群:https://t.me/tom_ww 10 | TG电报交流群: https://t.me/tom_210120 11 | boxjs地址 : 12 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 13 | 宝石消消乐 14 | 圈X配置如下,其他软件自行测试 15 | [task_local] 16 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 17 | #宝石消消乐 18 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/bsxxl.js, tag=宝石消消乐, enabled=true 19 | [rewrite_local] 20 | #宝石消消乐红包 21 | https://r1.nullpointerexception.cn/redpacket//f/ad/divident url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/bsxxl.js 22 | [MITM] 23 | hostname = r1.nullpointerexception.cn 24 | */ 25 | const $ = new Env('宝石消消乐'); 26 | let status; 27 | status = (status = ($.getval("bsxxlstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 28 | const bsxxlhdArr = [],bsxxlbodyArr = [],bsxxlcount = '' 29 | let bsxxlhd = $.getdata('bsxxlhd') 30 | let bsxxlbody = $.getdata('bsxxlbody') 31 | 32 | !(async () => { 33 | if (typeof $request !== "undefined") { 34 | await bsxxlck() 35 | 36 | } else { 37 | bsxxlhdArr.push($.getdata('bsxxlhd')) 38 | bsxxlbodyArr.push($.getdata('bsxxlbody')) 39 | let bsxxlcount = ($.getval('bsxxlcount') || '1'); 40 | for (let i = 2; i <= bsxxlcount; i++) { 41 | bsxxlhdArr.push($.getdata(`bsxxlhd${i}`)) 42 | bsxxlbodyArr.push($.getdata(`bsxxlbody${i}`)) 43 | } 44 | console.log(`------------- 共${bsxxlhdArr.length}个账号-------------\n`) 45 | for (let i = 0; i < bsxxlhdArr.length; i++) { 46 | if (bsxxlhdArr[i]) { 47 | bsxxlhd = bsxxlhdArr[i]; 48 | bsxxlbody = bsxxlbodyArr[i]; 49 | $.index = i + 1; 50 | console.log(`\n开始【宝石消消乐${$.index}】`) 51 | 52 | 53 | await bsxxlhb(); 54 | 55 | 56 | 57 | 58 | } 59 | }} 60 | 61 | })() 62 | .catch((e) => $.logErr(e)) 63 | .finally(() => $.done()) 64 | //数据获取 65 | 66 | 67 | function bsxxlck() { 68 | if ($request.url.indexOf("divident") > -1) { 69 | 70 | const bsxxlhd = JSON.stringify($request.headers) 71 | if(bsxxlhd) $.setdata(bsxxlhd,`bsxxlhd${status}`) 72 | $.log(bsxxlhd) 73 | const bsxxlbody = $request.body 74 | if(bsxxlbody) $.setdata(bsxxlbody,`bsxxlbody${status}`) 75 | $.log(bsxxlbody) 76 | $.msg($.name,"",'宝石消消乐'+`${status}` +'红包数据获取成功!') 77 | } 78 | } 79 | 80 | //红包 81 | function bsxxlhb(timeout = 0) { 82 | return new Promise((resolve) => { 83 | 84 | let url = { 85 | url : 'https://r1.nullpointerexception.cn/redpacket//f/ad/divident', 86 | headers : JSON.parse(bsxxlhd), 87 | body : bsxxlbody, 88 | } 89 | $.post(url, async (err, resp, data) => { 90 | try { 91 | //const result = JSON.parse(data) 92 | if(resp.statusCode == 200){ 93 | $.log(`\n宝石消消乐:成功领取红包`) 94 | } else { 95 | 96 | $.log(`\n宝石消消乐:领取失败${data}`) 97 | 98 | } 99 | 100 | } catch (e) { 101 | //$.logErr(e, resp); 102 | } finally { 103 | resolve() 104 | } 105 | },timeout) 106 | }) 107 | } 108 | 109 | 110 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 111 | -------------------------------------------------------------------------------- /cyds.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 软件名称:成语大师 4 | 更新时间:2021-09-27 @YaphetS0903 5 | 脚本说明:成语大师自动刷红包。。 6 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 7 | 成语大师使用方法: 8 | 1-点击气泡红包观看广告结束获得视频数据。 9 | 2-领取红包获得红包数据。 10 | 本脚本以学习为主 11 | 12 | TG通知群:https://t.me/tom_ww 13 | TG电报交流群: https://t.me/tom_210120 14 | 15 | boxjs地址 : 16 | 17 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 18 | 19 | 成语大师 20 | 圈X配置如下,其他软件自行测试 21 | [task_local] 22 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 23 | #成语大师 24 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/cyds.js, tag=成语大师, enabled=true 25 | [rewrite_local] 26 | #成语大师视频 27 | https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/ url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/cyds.js 28 | #成语大师红包 29 | https://r1.nullpointerexception.cn/redpacket//f/ad/divident url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/cyds.js 30 | [MITM] 31 | hostname = r1.nullpointerexception.cn, api-access.pangolin-sdk-toutiao.com 32 | */ 33 | const $ = new Env('成语大师'); 34 | let status; 35 | status = (status = ($.getval("cydsstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 36 | const cydshdArr = [],cydsbodyArr = [],cydsspbodyArr = [],cydscount = '' 37 | let cydshd = $.getdata('cydshd') 38 | let cydsbody = $.getdata('cydsbody') 39 | let cydsspbody = $.getdata('cydsspbody') 40 | const sphd = { 41 | 'Accept' : `*/*`, 42 | 'Accept-Encoding' : `gzip, deflate, br`, 43 | 'Connection' : `keep-alive`, 44 | 'Content-Type' : `application/json`, 45 | 'Host' : `api-access.pangolin-sdk-toutiao.com`, 46 | 'User-Agent' : `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`, 47 | 'Accept-Language' : `zh-Hans-CN;q=1` 48 | }; 49 | !(async () => { 50 | if (typeof $request !== "undefined") { 51 | await cydsck() 52 | 53 | } else { 54 | cydshdArr.push($.getdata('cydshd')) 55 | cydsbodyArr.push($.getdata('cydsbody')) 56 | cydsspbodyArr.push($.getdata('cydsspbody')) 57 | let cydscount = ($.getval('cydscount') || '1'); 58 | for (let i = 2; i <= cydscount; i++) { 59 | cydshdArr.push($.getdata(`cydshd${i}`)) 60 | cydsbodyArr.push($.getdata(`cydsbody${i}`)) 61 | cydsspbodyArr.push($.getdata(`cydsspbody${i}`)) 62 | } 63 | console.log(`------------- 共${cydshdArr.length}个账号-------------\n`) 64 | for (let i = 0; i < cydshdArr.length; i++) { 65 | if (cydshdArr[i]) { 66 | cydshd = cydshdArr[i]; 67 | cydsbody = cydsbodyArr[i]; 68 | cydsspbody = cydsspbodyArr[i]; 69 | $.index = i + 1; 70 | console.log(`\n开始【成语大师${$.index}】`) 71 | 72 | 73 | await cydssp(); 74 | 75 | 76 | 77 | 78 | } 79 | }} 80 | 81 | })() 82 | .catch((e) => $.logErr(e)) 83 | .finally(() => $.done()) 84 | //数据获取 85 | 86 | 87 | function cydsck() { 88 | if ($request.url.indexOf("divident") > -1) { 89 | 90 | const cydshd = JSON.stringify($request.headers) 91 | if(cydshd) $.setdata(cydshd,`cydshd${status}`) 92 | $.log(cydshd) 93 | const cydsbody = $request.body 94 | if(cydsbody) $.setdata(cydsbody,`cydsbody${status}`) 95 | $.log(cydsbody) 96 | $.msg($.name,"",'成语大师'+`${status}` +'红包数据获取成功!') 97 | }else if ($request.url.indexOf("reward_video/reward/") > -1) { 98 | 99 | const cydsspbody = $request.body 100 | if(cydsspbody) $.setdata(cydsspbody,`cydsspbody${status}`) 101 | $.log(cydsspbody) 102 | $.msg($.name,"",'成语大师'+`${status}` +'视频数据获取成功!') 103 | } 104 | } 105 | 106 | //红包 107 | function cydshb(timeout = 0) { 108 | return new Promise((resolve) => { 109 | 110 | let url = { 111 | url : 'https://r1.nullpointerexception.cn/redpacket//f/ad/divident', 112 | headers : JSON.parse(cydshd), 113 | body : cydsbody, 114 | } 115 | $.post(url, async (err, resp, data) => { 116 | try { 117 | //const result = JSON.parse(data) 118 | if(resp.statusCode == 200){ 119 | $.log(`\n成语大师:成功领取红包`) 120 | } else { 121 | 122 | $.log(`\n成语大师:领取失败${data}`) 123 | 124 | } 125 | 126 | } catch (e) { 127 | //$.logErr(e, resp); 128 | } finally { 129 | resolve() 130 | } 131 | },timeout) 132 | }) 133 | } 134 | 135 | 136 | function cydssp(timeout = 0) { 137 | return new Promise((resolve) => { 138 | 139 | let url = { 140 | url : 'https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/', 141 | headers : sphd, 142 | body : cydsspbody, 143 | } 144 | $.post(url, async (err, resp, data) => { 145 | try { 146 | const result = JSON.parse(data) 147 | if(result.cypher == 3){ 148 | $.log(`\n成语大师视频观看成功`) 149 | await $.wait(15000) 150 | await cydshb(); 151 | 152 | } else { 153 | 154 | $.log(`\n成语大师视频观看失败:${data}`) 155 | 156 | } 157 | 158 | } catch (e) { 159 | //$.logErr(e, resp); 160 | } finally { 161 | resolve() 162 | } 163 | },timeout) 164 | }) 165 | } 166 | 167 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 168 | -------------------------------------------------------------------------------- /cydxs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 软件名称:成语大学士 4 | 更新时间:2021-09-27 @YaphetS0903 5 | 脚本说明:成语大学士自动刷红包。。 6 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 7 | 成语大学士使用方法: 8 | 1-点击气泡红包观看广告结束获得视频数据。 9 | 2-领取红包获得红包数据。 10 | 本脚本以学习为主 11 | 12 | TG通知群:https://t.me/tom_ww 13 | TG电报交流群: https://t.me/tom_210120 14 | 15 | boxjs地址 : 16 | 17 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 18 | 19 | 成语大学士 20 | 圈X配置如下,其他软件自行测试 21 | [task_local] 22 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 23 | #成语大学士 24 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/cydxs.js, tag=成语大学士, enabled=true 25 | [rewrite_local] 26 | #成语大学士视频 27 | https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/ url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/cydxs.js 28 | #成语大学士红包 29 | https://r1.nullpointerexception.cn/redpacket//f/ad/divident url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/cydxs.js 30 | [MITM] 31 | hostname = r1.nullpointerexception.cn, api-access.pangolin-sdk-toutiao.com 32 | */ 33 | const $ = new Env('成语大学士'); 34 | let status; 35 | status = (status = ($.getval("cydxsstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 36 | const cydxshdArr = [],cydxsbodyArr = [],cydxsspbodyArr = [],cydxscount = '' 37 | let cydxshd = $.getdata('cydxshd') 38 | let cydxsbody = $.getdata('cydxsbody') 39 | let cydxsspbody = $.getdata('cydxsspbody') 40 | const sphd = { 41 | 'Accept' : `*/*`, 42 | 'Accept-Encoding' : `gzip, deflate, br`, 43 | 'Connection' : `keep-alive`, 44 | 'Content-Type' : `application/json`, 45 | 'Host' : `api-access.pangolin-sdk-toutiao.com`, 46 | 'User-Agent' : `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`, 47 | 'Accept-Language' : `zh-Hans-CN;q=1` 48 | }; 49 | !(async () => { 50 | if (typeof $request !== "undefined") { 51 | await cydxsck() 52 | 53 | } else { 54 | cydxshdArr.push($.getdata('cydxshd')) 55 | cydxsbodyArr.push($.getdata('cydxsbody')) 56 | cydxsspbodyArr.push($.getdata('cydxsspbody')) 57 | let cydxscount = ($.getval('cydxscount') || '1'); 58 | for (let i = 2; i <= cydxscount; i++) { 59 | cydxshdArr.push($.getdata(`cydxshd${i}`)) 60 | cydxsbodyArr.push($.getdata(`cydxsbody${i}`)) 61 | cydxsspbodyArr.push($.getdata(`cydxsspbody${i}`)) 62 | } 63 | console.log(`------------- 共${cydxshdArr.length}个账号-------------\n`) 64 | for (let i = 0; i < cydxshdArr.length; i++) { 65 | if (cydxshdArr[i]) { 66 | cydxshd = cydxshdArr[i]; 67 | cydxsbody = cydxsbodyArr[i]; 68 | cydxsspbody = cydxsspbodyArr[i]; 69 | $.index = i + 1; 70 | console.log(`\n开始【成语大学士${$.index}】`) 71 | 72 | 73 | await cydxssp(); 74 | 75 | 76 | 77 | 78 | } 79 | }} 80 | 81 | })() 82 | .catch((e) => $.logErr(e)) 83 | .finally(() => $.done()) 84 | //数据获取 85 | 86 | 87 | function cydxsck() { 88 | if ($request.url.indexOf("divident") > -1) { 89 | 90 | const cydxshd = JSON.stringify($request.headers) 91 | if(cydxshd) $.setdata(cydxshd,`cydxshd${status}`) 92 | $.log(cydxshd) 93 | const cydxsbody = $request.body 94 | if(cydxsbody) $.setdata(cydxsbody,`cydxsbody${status}`) 95 | $.log(cydxsbody) 96 | $.msg($.name,"",'成语大学士'+`${status}` +'红包数据获取成功!') 97 | }else if ($request.url.indexOf("reward_video/reward/") > -1) { 98 | 99 | const cydxsspbody = $request.body 100 | if(cydxsspbody) $.setdata(cydxsspbody,`cydxsspbody${status}`) 101 | $.log(cydxsspbody) 102 | $.msg($.name,"",'成语大学士'+`${status}` +'视频数据获取成功!') 103 | } 104 | } 105 | 106 | //红包 107 | function cydxshb(timeout = 0) { 108 | return new Promise((resolve) => { 109 | 110 | let url = { 111 | url : 'https://r1.nullpointerexception.cn/redpacket//f/ad/divident', 112 | headers : JSON.parse(cydxshd), 113 | body : cydxsbody, 114 | } 115 | $.post(url, async (err, resp, data) => { 116 | try { 117 | //const result = JSON.parse(data) 118 | if(resp.statusCode == 200){ 119 | $.log(`\n成语大学士:成功领取红包`) 120 | } else { 121 | 122 | $.log(`\n成语大学士:领取失败${data}`) 123 | 124 | } 125 | 126 | } catch (e) { 127 | //$.logErr(e, resp); 128 | } finally { 129 | resolve() 130 | } 131 | },timeout) 132 | }) 133 | } 134 | 135 | 136 | function cydxssp(timeout = 0) { 137 | return new Promise((resolve) => { 138 | 139 | let url = { 140 | url : 'https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/', 141 | headers : sphd, 142 | body : cydxsspbody, 143 | } 144 | $.post(url, async (err, resp, data) => { 145 | try { 146 | const result = JSON.parse(data) 147 | if(result.cypher == 3){ 148 | $.log(`\n成语大学士视频观看成功`) 149 | await $.wait(15000) 150 | await cydxshb(); 151 | 152 | } else { 153 | 154 | $.log(`\n成语大学士视频观看失败:${data}`) 155 | 156 | } 157 | 158 | } catch (e) { 159 | //$.logErr(e, resp); 160 | } finally { 161 | resolve() 162 | } 163 | },timeout) 164 | }) 165 | } 166 | 167 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 168 | -------------------------------------------------------------------------------- /dfhz.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:多福盒子 3 | 更新时间:2021-10-11 @YaphetS0903 4 | 脚本说明:多福盒子。。。下载地址邀请(介意的话appstore搜索下载)https://raw.githubusercontent.com/YaphetS0903/JStest/main/image/dfhz.png 5 | 一天1左右,能抢现金和实物 6 | 每日0.3和10元提现要抢,数量很少,每天8点开抢,0.3数量每天88个,脚本自动抢。 7 | 提醒:抢提现金额要绑定手机号和地址(地址乱填),不然抢不到 8 | 本脚本以学习为主 9 | 获取数据: 进入软件,点击换鸡蛋,随便完成一个元宝视频任务即可获取数据 10 | TG通知群:https://t.me/tom_ww 11 | TG电报交流群: https://t.me/tom_210120 12 | boxjs地址 : 13 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 14 | 多福盒子 15 | 青龙环境抓取链接http://api.duofu.xqustar.com/api/task/finshTask 16 | 环境配置(@隔开,json格式)export dfhzhd='抓取的header1@抓取的header2' 17 | 圈X配置如下,其他自行测试,加了判断,运行时间随意,早上8点刷新0.3,九点要运行一次自动抢 18 | [task_local] 19 | #多福盒子 20 | 0 0 8-18 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/dfhz.js, tag=多福盒子, enabled=true 21 | [rewrite_local] 22 | #多福盒子 23 | http://api.duofu.xqustar.com/api/task/finshTask url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/dfhz.js 24 | [MITM] 25 | hostname = api.duofu.xqustar.com 26 | */ 27 | const $ = new Env('多福盒子'); 28 | let status; 29 | 30 | status = (status = ($.getval("dfhzstatus") || "1")) > 1 ? `${status}` : ""; 31 | let dfhzurlArr = [], dfhzhdArr = [], dfhzcount = '' 32 | let dfhzurl = $.getdata('dfhzurl') 33 | let dfhzhd = $.isNode() ? (process.env.dfhzhd ? process.env.dfhzhd : "") : ($.getdata('dfhzhd') ? $.getdata('dfhzhd') : "") 34 | 35 | let b = Math.round(new Date().getTime() / 1000).toString(); 36 | let DD = RT(15000, 20000) 37 | let tz = ($.getval('tz') || '1'); 38 | let tx = ($.getval('tx') || '1'); 39 | let id = '', txid = '', aid = '', pid = '' 40 | $.message = '' 41 | let dfhzhds = "" 42 | 43 | 44 | 45 | 46 | !(async () => { 47 | if (typeof $request !== "undefined") { 48 | await dfhzck() 49 | } else { 50 | if (!$.isNode()) { 51 | dfhzurlArr.push($.getdata('dfhzurl')) 52 | dfhzhdArr.push($.getdata('dfhzhd')) 53 | 54 | let dfhzcount = ($.getval('dfhzcount') || '1'); 55 | for (let i = 2; i <= dfhzcount; i++) { 56 | dfhzurlArr.push($.getdata(`dfhzurl${i}`)) 57 | dfhzhdArr.push($.getdata(`dfhzhd${i}`)) 58 | 59 | } 60 | console.log( 61 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 62 | new Date().getTime() + 63 | new Date().getTimezoneOffset() * 60 * 1000 + 64 | 8 * 60 * 60 * 1000 65 | ).toLocaleString()} ===============================================\n`); 66 | for (let i = 0; i < dfhzhdArr.length; i++) { 67 | if (dfhzhdArr[i]) { 68 | 69 | dfhzurl = dfhzurlArr[i]; 70 | dfhzhd = dfhzhdArr[i]; 71 | 72 | 73 | $.index = i + 1; 74 | console.log(`\n\n开始【多福盒子${$.index}】`) 75 | await dfhzaddress() 76 | await $.wait(15000) 77 | await dfhztasklist() 78 | await $.wait(15000) 79 | 80 | //message() 81 | } 82 | } 83 | } else { 84 | if (process.env.dfhzhd && process.env.dfhzhd.indexOf('@') > -1) { 85 | dfhzhdArr = process.env.dfhzhd.split('@'); 86 | console.log(`您选择的是用"@"隔开\n`) 87 | } else { 88 | dfhzhds = [process.env.dfhzhd] 89 | }; 90 | Object.keys(dfhzhds).forEach((item) => { 91 | if (dfhzhds[item]) { 92 | dfhzhdArr.push(dfhzhds[item]) 93 | } 94 | }) 95 | console.log(`共${dfhzhdArr.length}个cookie`) 96 | for (let k = 0; k < dfhzhdArr.length; k++) { 97 | $.message = "" 98 | dfhzhd = dfhzhdArr[k] 99 | $.index = k + 1; 100 | console.log(`\n开始【多福盒子${$.index}】`) 101 | await dfhzaddress() 102 | await $.wait(15000) 103 | await dfhztasklist() 104 | await $.wait(15000) 105 | //message() 106 | } 107 | } 108 | 109 | } 110 | })() 111 | 112 | .catch((e) => $.logErr(e)) 113 | .finally(() => $.done()) 114 | 115 | 116 | 117 | 118 | 119 | function dfhzck() { 120 | if ($request.url.indexOf("task/finshTask") > -1) { 121 | const dfhzurl = $request.url 122 | if (dfhzurl) $.setdata(dfhzurl, `dfhzurl${status}`) 123 | $.log(dfhzurl) 124 | 125 | const dfhzhd = JSON.stringify($request.headers) 126 | if (dfhzhd) $.setdata(dfhzhd, `dfhzhd${status}`) 127 | $.log(dfhzhd) 128 | 129 | 130 | 131 | $.msg($.name, "", `多福盒子${status}获取headers成功`) 132 | 133 | } 134 | } 135 | 136 | 137 | 138 | 139 | //刷视频 140 | function dfhzsp(timeout = 0) { 141 | return new Promise((resolve) => { 142 | 143 | let url = { 144 | url: `http://api.duofu.xqustar.com/api/video/immediatelyaward?type=clockvideo`, 145 | headers: JSON.parse(dfhzhd), 146 | 147 | } 148 | $.get(url, async (err, resp, data) => { 149 | try { 150 | 151 | const result = JSON.parse(data) 152 | 153 | if (result.code == 200) { 154 | console.log(`【看视频赚元宝】:${result.message}\n`) 155 | console.log(`【获得元宝】:${result.data.award}\n`) 156 | 157 | 158 | } else { 159 | 160 | console.log(`【看视频赚元宝失败】:${result.message}\n`) 161 | 162 | 163 | } 164 | } catch (e) { 165 | 166 | } finally { 167 | 168 | resolve() 169 | } 170 | }, timeout) 171 | }) 172 | } 173 | 174 | 175 | 176 | 177 | //任务列表 178 | function dfhztasklist(timeout = 0) { 179 | return new Promise((resolve) => { 180 | 181 | let url = { 182 | url: `http://api.duofu.xqustar.com/api/task/list`, 183 | headers: JSON.parse(dfhzhd), 184 | 185 | } 186 | $.get(url, async (err, resp, data) => { 187 | try { 188 | 189 | const result = JSON.parse(data) 190 | 191 | if (result.code == 200) { 192 | console.log(`【查询任务列表列表】:${result.message}\n`) 193 | 194 | if (result.data[1].list[0].finishtimes >= 1) { 195 | console.log(`【今日刷视频任务已完成】\n`) 196 | } 197 | // else { 198 | // console.log(`【开始刷视频任务】\n`) 199 | // for (let m = 0; m < 10; m++) { 200 | // await dfhzsp() 201 | // await $.wait(DD) 202 | // } 203 | //await dfhzvideo() 204 | // await $.wait(2000) 205 | // } 206 | 207 | if (result.data[1].list[2].finishtimes >= 1) { 208 | console.log(`【今日分享祝福任务已完成】\n`) 209 | } else { 210 | console.log(`【开始分享祝福任务】\n`) 211 | await $.wait(20000) 212 | await dfhzshare() 213 | 214 | } 215 | if (result.data[1].list[3].finishtimes >= 10) { 216 | console.log(`【今日元宝奖励视频任务已完成】\n`) 217 | } else { 218 | console.log(`【开始元宝奖励视频任务】\n`) 219 | await $.wait(20000) 220 | await dfhzybjlsp() 221 | 222 | } 223 | if (result.data[1].list[4].finishtimes >= 10) { 224 | console.log(`【今日元宝福利视频任务已完成】\n`) 225 | } else { 226 | console.log(`【开始元宝福利视频任务】\n`) 227 | await $.wait(20000) 228 | await dfhzybflsp() 229 | 230 | } 231 | if (result.data[1].list[5].finishtimes >= 10) { 232 | console.log(`【今日超级元宝视频任务已完成】\n`) 233 | } else { 234 | console.log(`【开始超级元宝视频任务】\n`) 235 | await $.wait(20000) 236 | await dfhzcjybsp() 237 | 238 | console.log(`【开始刷视频任务】\n`) 239 | for (let m = 0; m < 5; m++) { 240 | await dfhzsp() 241 | await $.wait(30000) 242 | } 243 | } 244 | 245 | } else { 246 | 247 | console.log(`【查询任务列表】:${result.message}\n`) 248 | 249 | } 250 | } catch (e) { 251 | 252 | } finally { 253 | 254 | resolve() 255 | } 256 | }, timeout) 257 | }) 258 | } 259 | 260 | 261 | 262 | 263 | //刷短视频任务 264 | function dfhzvideo(timeout = 0) { 265 | return new Promise((resolve) => { 266 | 267 | let url = { 268 | url: `http://api.duofu.xqustar.com/api/task/finshTask`, 269 | headers: JSON.parse(dfhzhd), 270 | body: `{ 271 | "taskcode": "clockvideo", 272 | "achieve": true 273 | }`, 274 | } 275 | $.post(url, async (err, resp, data) => { 276 | try { 277 | 278 | const result = JSON.parse(data) 279 | 280 | if (result.code == 200) { 281 | 282 | console.log(`【短视频任务】:${result.message}\n`) 283 | await dfhzvideoreward() 284 | await $.wait(15000) 285 | 286 | } else { 287 | 288 | console.log(`【短视频任务失败】:${result.message}\n`) 289 | 290 | 291 | } 292 | } catch (e) { 293 | 294 | } finally { 295 | 296 | resolve() 297 | } 298 | }, timeout) 299 | }) 300 | } 301 | 302 | 303 | 304 | 305 | //领取刷短视频奖励 306 | function dfhzvideoreward(timeout = 0) { 307 | return new Promise((resolve) => { 308 | 309 | let url = { 310 | url: `http://api.duofu.xqustar.com/api/task/receiveDiamond`, 311 | headers: JSON.parse(dfhzhd), 312 | body: `{ 313 | "double": "true", 314 | "taskcode": "clockvideo" 315 | }`, 316 | } 317 | $.post(url, async (err, resp, data) => { 318 | try { 319 | 320 | const result = JSON.parse(data) 321 | 322 | if (result.code == 200) { 323 | 324 | 325 | 326 | console.log(`【短视频任务领取奖励】:${result.message}\n`) 327 | 328 | } else { 329 | 330 | console.log(`【短视频任务领取奖励失败】:${result.message}\n`) 331 | } 332 | } catch (e) { 333 | 334 | } finally { 335 | 336 | resolve() 337 | } 338 | }, timeout) 339 | }) 340 | } 341 | 342 | 343 | //分享任务 344 | function dfhzshare(timeout = 0) { 345 | return new Promise((resolve) => { 346 | 347 | let url = { 348 | url: `http://api.duofu.xqustar.com/api/task/finshTask`, 349 | headers: JSON.parse(dfhzhd), 350 | body: `{ 351 | "taskcode": "share", 352 | "achieve": true 353 | }`, 354 | } 355 | $.post(url, async (err, resp, data) => { 356 | try { 357 | 358 | const result = JSON.parse(data) 359 | 360 | if (result.code == 200) { 361 | 362 | console.log(`【分享任务】:${result.message}\n`) 363 | await dfhzsharereward() 364 | await $.wait(15000) 365 | 366 | } else { 367 | 368 | console.log(`【分享任务失败】:${result.message}\n`) 369 | 370 | 371 | } 372 | } catch (e) { 373 | 374 | } finally { 375 | 376 | resolve() 377 | } 378 | }, timeout) 379 | }) 380 | } 381 | 382 | 383 | 384 | 385 | //领取分享奖励 386 | function dfhzsharereward(timeout = 0) { 387 | return new Promise((resolve) => { 388 | 389 | let url = { 390 | url: `http://api.duofu.xqustar.com/api/task/receiveDiamond`, 391 | headers: JSON.parse(dfhzhd), 392 | body: `{ 393 | "double": "false", 394 | "taskcode": "share" 395 | }`, 396 | } 397 | $.post(url, async (err, resp, data) => { 398 | try { 399 | 400 | const result = JSON.parse(data) 401 | 402 | if (result.code == 200) { 403 | 404 | 405 | 406 | console.log(`【分享任务领取奖励】:${result.message}\n`) 407 | 408 | } else { 409 | 410 | console.log(`【分享任务领取奖励失败】:${result.message}\n`) 411 | } 412 | } catch (e) { 413 | 414 | } finally { 415 | 416 | resolve() 417 | } 418 | }, timeout) 419 | }) 420 | } 421 | 422 | //元宝奖励视频 423 | function dfhzybjlsp(timeout = 0) { 424 | return new Promise((resolve) => { 425 | 426 | let url = { 427 | url: `http://api.duofu.xqustar.com/api/task/finshTask`, 428 | headers: JSON.parse(dfhzhd), 429 | body: `{ 430 | "taskcode": "csjjlios", 431 | "achieve": true 432 | }`, 433 | } 434 | $.post(url, async (err, resp, data) => { 435 | try { 436 | 437 | const result = JSON.parse(data) 438 | 439 | if (result.code == 200) { 440 | 441 | console.log(`【元宝奖励视频任务】:${result.message}\n`) 442 | await dfhzybjlspreward() 443 | await $.wait(15000) 444 | 445 | 446 | } else { 447 | 448 | console.log(`【元宝奖励视频任务失败】:${result.message}\n`) 449 | 450 | 451 | } 452 | } catch (e) { 453 | 454 | } finally { 455 | 456 | resolve() 457 | } 458 | }, timeout) 459 | }) 460 | } 461 | 462 | 463 | 464 | 465 | //元宝奖励视频领取奖励 466 | function dfhzybjlspreward(timeout = 0) { 467 | return new Promise((resolve) => { 468 | 469 | let url = { 470 | url: `http://api.duofu.xqustar.com/api/task/receiveDiamond`, 471 | headers: JSON.parse(dfhzhd), 472 | body: `{ 473 | "double": "false", 474 | "taskcode": "csjjlios" 475 | }`, 476 | } 477 | $.post(url, async (err, resp, data) => { 478 | try { 479 | 480 | const result = JSON.parse(data) 481 | 482 | if (result.code == 200) { 483 | 484 | 485 | 486 | console.log(`【元宝奖励视频领取奖励】:${result.message}\n`) 487 | 488 | } else { 489 | 490 | console.log(`【元宝奖励视频领取奖励失败】:${result.message}\n`) 491 | } 492 | } catch (e) { 493 | 494 | } finally { 495 | 496 | resolve() 497 | } 498 | }, timeout) 499 | }) 500 | } 501 | 502 | 503 | 504 | 505 | //元宝福利视频 506 | function dfhzybflsp(timeout = 0) { 507 | return new Promise((resolve) => { 508 | 509 | let url = { 510 | url: `http://api.duofu.xqustar.com/api/task/finshTask`, 511 | headers: JSON.parse(dfhzhd), 512 | body: `{ 513 | "taskcode": "gdtjlios", 514 | "achieve": true 515 | }`, 516 | } 517 | $.post(url, async (err, resp, data) => { 518 | try { 519 | 520 | const result = JSON.parse(data) 521 | 522 | if (result.code == 200) { 523 | 524 | console.log(`【元宝福利视频任务】:${result.message}\n`) 525 | 526 | await dfhzybjlspreward() 527 | await $.wait(15000) 528 | 529 | 530 | } else { 531 | 532 | console.log(`【元宝福利视频任务失败】:${result.message}\n`) 533 | 534 | 535 | } 536 | } catch (e) { 537 | 538 | } finally { 539 | 540 | resolve() 541 | } 542 | }, timeout) 543 | }) 544 | } 545 | 546 | 547 | 548 | 549 | //元宝福利视频领取奖励 550 | function dfhzybjlspreward(timeout = 0) { 551 | return new Promise((resolve) => { 552 | 553 | let url = { 554 | url: `http://api.duofu.xqustar.com/api/task/receiveDiamond`, 555 | headers: JSON.parse(dfhzhd), 556 | body: `{ 557 | "double": "false", 558 | "taskcode": "gdtjlios" 559 | }`, 560 | } 561 | $.post(url, async (err, resp, data) => { 562 | try { 563 | 564 | const result = JSON.parse(data) 565 | 566 | if (result.code == 200) { 567 | 568 | 569 | 570 | console.log(`【元宝福利视频领取奖励】:${result.message}\n`) 571 | 572 | } else { 573 | 574 | console.log(`【元宝福利视频领取奖励失败】:${result.message}\n`) 575 | } 576 | } catch (e) { 577 | 578 | } finally { 579 | 580 | resolve() 581 | } 582 | }, timeout) 583 | }) 584 | } 585 | 586 | 587 | //超级元宝视频 588 | function dfhzcjybsp(timeout = 0) { 589 | return new Promise((resolve) => { 590 | 591 | let url = { 592 | url: `http://api.duofu.xqustar.com/api/task/finshTask`, 593 | headers: JSON.parse(dfhzhd), 594 | body: `{ 595 | "taskcode": "ksjlios", 596 | "achieve": true 597 | }`, 598 | } 599 | $.post(url, async (err, resp, data) => { 600 | try { 601 | 602 | const result = JSON.parse(data) 603 | 604 | if (result.code == 200) { 605 | 606 | console.log(`【超级元宝视频任务】:${result.message}\n`) 607 | 608 | await dfhzcjybspreward() 609 | await $.wait(15000) 610 | 611 | } else { 612 | 613 | console.log(`【超级元宝视频任务失败】:${result.message}\n`) 614 | 615 | 616 | } 617 | } catch (e) { 618 | 619 | } finally { 620 | 621 | resolve() 622 | } 623 | }, timeout) 624 | }) 625 | } 626 | 627 | 628 | 629 | 630 | //超级元宝视频领取奖励 631 | function dfhzcjybspreward(timeout = 0) { 632 | return new Promise((resolve) => { 633 | 634 | let url = { 635 | url: `http://api.duofu.xqustar.com/api/task/receiveDiamond`, 636 | headers: JSON.parse(dfhzhd), 637 | body: `{ 638 | "double": "false", 639 | "taskcode": "ksjlios" 640 | }`, 641 | } 642 | $.post(url, async (err, resp, data) => { 643 | try { 644 | 645 | const result = JSON.parse(data) 646 | 647 | if (result.code == 200) { 648 | 649 | 650 | 651 | console.log(`【超级元宝视频领取奖励】:${result.message}\n`) 652 | 653 | } else { 654 | 655 | console.log(`【超级元宝视频领取奖励失败】:${result.message}\n`) 656 | } 657 | } catch (e) { 658 | 659 | } finally { 660 | 661 | resolve() 662 | } 663 | }, timeout) 664 | }) 665 | } 666 | 667 | //获取地址信息 668 | function dfhzaddress(timeout = 0) { 669 | return new Promise((resolve) => { 670 | 671 | let url = { 672 | url: `http://api.duofu.xqustar.com/api/userAddress/list`, 673 | headers: JSON.parse(dfhzhd), 674 | 675 | } 676 | $.get(url, async (err, resp, data) => { 677 | try { 678 | 679 | const result = JSON.parse(data) 680 | 681 | if (result.code == 200) { 682 | if(nowTimes.getHours() === 8){ 683 | console.log(`【开始准备提现0.3】\n`) 684 | console.log(`【获得地址信息】:${result.data[0].id}\n`) 685 | await dfhzgoodlist() 686 | aid =result.data[0].id 687 | }else{console.log(`【未到8点,不能提现】\n`)} 688 | } else { 689 | 690 | console.log(`【获得地址信息失败】:${result.message}\n`) 691 | } 692 | } catch (e) { 693 | 694 | } finally { 695 | 696 | resolve() 697 | } 698 | }, timeout) 699 | }) 700 | } 701 | 702 | //查询兑换商品信息 703 | function dfhzgoodlist(timeout = 0) { 704 | return new Promise((resolve) => { 705 | 706 | let url = { 707 | url: `http://api.duofu.xqustar.com/api/goods/list?pn=1&ps=10&time=1633879473619&type=all`, 708 | headers: JSON.parse(dfhzhd), 709 | 710 | } 711 | $.get(url, async (err, resp, data) => { 712 | try { 713 | 714 | const result = JSON.parse(data) 715 | 716 | if (result.code == 200) { 717 | console.log(`【查询兑换0.3兑换id】:${result.message}\n`) 718 | pid =result.data.list[0].id 719 | await $.wait(5000) 720 | await dfhztx() 721 | } else { 722 | 723 | console.log(`【查询兑换0.3兑换id失败】:${result.message}\n`) 724 | } 725 | } catch (e) { 726 | 727 | } finally { 728 | 729 | resolve() 730 | } 731 | }, timeout) 732 | }) 733 | } 734 | 735 | 736 | //抢0.3 737 | function dfhztx(timeout = 0) { 738 | return new Promise((resolve) => { 739 | 740 | let url = { 741 | url: `http://api.duofu.xqustar.com/api/goods/exchange`, 742 | headers: JSON.parse(dfhzhd), 743 | body: `{ 744 | "sum": 1, 745 | "addressID": "${aid}", 746 | "productId": "${pid}" 747 | } 748 | `, 749 | } 750 | $.post(url, async (err, resp, data) => { 751 | try { 752 | 753 | const result = JSON.parse(data) 754 | 755 | if (result.code == 200) { 756 | 757 | 758 | 759 | console.log(`【兑换0.3】:${result.message}\n`) 760 | 761 | } else { 762 | 763 | console.log(`【兑换失败,太慢了】:${result.message}\n`) 764 | } 765 | } catch (e) { 766 | 767 | } finally { 768 | 769 | resolve() 770 | } 771 | }, timeout) 772 | }) 773 | } 774 | 775 | 776 | 777 | function message() { 778 | if (tz == 1) { $.msg($.name, "", $.message) } 779 | } 780 | //时间 781 | nowTimes = new Date( 782 | new Date().getTime() + 783 | new Date().getTimezoneOffset() * 60 * 1000 + 784 | 8 * 60 * 60 * 1000 785 | ); 786 | 787 | function RT(X, Y) { 788 | do rt = Math.floor(Math.random() * Y); 789 | while (rt < X) 790 | return rt; 791 | } 792 | 793 | 794 | //console.log('\n'+getCurrentDate()); 795 | function getCurrentDate() { 796 | var date = new Date(); 797 | var seperator1 = "-"; 798 | var seperator2 = ":"; 799 | var month = date.getMonth() + 1; 800 | var strDate = date.getDate(); 801 | if (month >= 1 && month <= 9) { 802 | month = "0" + month; 803 | } 804 | if (strDate >= 0 && strDate <= 9) { 805 | strDate = "0" + strDate; 806 | } 807 | var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate 808 | + " " + date.getHours() + seperator2 + date.getMinutes() 809 | + seperator2 + date.getSeconds(); 810 | return currentdate; 811 | 812 | 813 | } 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } 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) } 827 | -------------------------------------------------------------------------------- /dtwz.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 软件名称:答题王者 4 | 更新时间:2021-09-27 @YaphetS0903 5 | 脚本说明:答题王者自动刷红包。。 6 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 7 | 答题王者使用方法: 8 | 1-点击气泡红包观看广告结束获得视频数据。 9 | 2-领取红包获得红包数据。 10 | 本脚本以学习为主 11 | 12 | TG通知群:https://t.me/tom_ww 13 | TG电报交流群: https://t.me/tom_210120 14 | 15 | boxjs地址 : 16 | 17 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 18 | 19 | 答题王者 20 | 圈X配置如下,其他软件自行测试 21 | [task_local] 22 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 23 | #答题王者 24 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/dtwz.js, tag=答题王者, enabled=true 25 | [rewrite_local] 26 | #答题王者视频 27 | https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/ url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/dtwz.js 28 | #答题王者红包 29 | https://r1.nullpointerexception.cn/redpacket//f/ad/divident url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/dtwz.js 30 | [MITM] 31 | hostname = r1.nullpointerexception.cn, api-access.pangolin-sdk-toutiao.com 32 | 33 | 34 | */ 35 | 36 | const $ = new Env('答题王者'); 37 | let status; 38 | status = (status = ($.getval("dtwzstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 39 | const dtwzhdArr = [],dtwzbodyArr = [],dtwzspbodyArr = [],dtwzcount = '' 40 | let dtwzhd = $.getdata('dtwzhd') 41 | let dtwzbody = $.getdata('dtwzbody') 42 | let dtwzspbody = $.getdata('dtwzspbody') 43 | const sphd = { 44 | 'Accept' : `*/*`, 45 | 'Accept-Encoding' : `gzip, deflate, br`, 46 | 'Connection' : `keep-alive`, 47 | 'Content-Type' : `application/json`, 48 | 'Host' : `api-access.pangolin-sdk-toutiao.com`, 49 | 'User-Agent' : `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`, 50 | 'Accept-Language' : `zh-Hans-CN;q=1` 51 | }; 52 | !(async () => { 53 | if (typeof $request !== "undefined") { 54 | await dtwzck() 55 | 56 | } else { 57 | dtwzhdArr.push($.getdata('dtwzhd')) 58 | dtwzbodyArr.push($.getdata('dtwzbody')) 59 | dtwzspbodyArr.push($.getdata('dtwzspbody')) 60 | let dtwzcount = ($.getval('dtwzcount') || '1'); 61 | for (let i = 2; i <= dtwzcount; i++) { 62 | dtwzhdArr.push($.getdata(`dtwzhd${i}`)) 63 | dtwzbodyArr.push($.getdata(`dtwzbody${i}`)) 64 | dtwzspbodyArr.push($.getdata(`dtwzspbody${i}`)) 65 | } 66 | console.log(`------------- 共${dtwzhdArr.length}个账号-------------\n`) 67 | for (let i = 0; i < dtwzhdArr.length; i++) { 68 | if (dtwzhdArr[i]) { 69 | dtwzhd = dtwzhdArr[i]; 70 | dtwzbody = dtwzbodyArr[i]; 71 | dtwzspbody = dtwzspbodyArr[i]; 72 | $.index = i + 1; 73 | console.log(`\n开始【答题王者${$.index}】`) 74 | 75 | 76 | await dtwzsp(); 77 | 78 | 79 | 80 | 81 | } 82 | }} 83 | 84 | })() 85 | .catch((e) => $.logErr(e)) 86 | .finally(() => $.done()) 87 | //数据获取 88 | 89 | 90 | function dtwzck() { 91 | if ($request.url.indexOf("divident") > -1) { 92 | 93 | const dtwzhd = JSON.stringify($request.headers) 94 | if(dtwzhd) $.setdata(dtwzhd,`dtwzhd${status}`) 95 | $.log(dtwzhd) 96 | const dtwzbody = $request.body 97 | if(dtwzbody) $.setdata(dtwzbody,`dtwzbody${status}`) 98 | $.log(dtwzbody) 99 | $.msg($.name,"",'答题王者'+`${status}` +'红包数据获取成功!') 100 | }else if ($request.url.indexOf("reward_video/reward/") > -1) { 101 | 102 | const dtwzspbody = $request.body 103 | if(dtwzspbody) $.setdata(dtwzspbody,`dtwzspbody${status}`) 104 | $.log(dtwzspbody) 105 | $.msg($.name,"",'答题王者'+`${status}` +'视频数据获取成功!') 106 | } 107 | } 108 | 109 | //红包 110 | function dtwzhb(timeout = 0) { 111 | return new Promise((resolve) => { 112 | 113 | let url = { 114 | url : 'https://r1.nullpointerexception.cn/redpacket//f/ad/divident', 115 | headers : JSON.parse(dtwzhd), 116 | body : dtwzbody, 117 | } 118 | $.post(url, async (err, resp, data) => { 119 | try { 120 | //const result = JSON.parse(data) 121 | if(resp.statusCode == 200){ 122 | $.log(`\n答题王者:成功领取红包`) 123 | } else { 124 | 125 | $.log(`\n答题王者:领取失败${data}`) 126 | 127 | } 128 | 129 | } catch (e) { 130 | //$.logErr(e, resp); 131 | } finally { 132 | resolve() 133 | } 134 | },timeout) 135 | }) 136 | } 137 | 138 | 139 | function dtwzsp(timeout = 0) { 140 | return new Promise((resolve) => { 141 | 142 | let url = { 143 | url : 'https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/', 144 | headers : sphd, 145 | body : dtwzspbody, 146 | } 147 | $.post(url, async (err, resp, data) => { 148 | try { 149 | const result = JSON.parse(data) 150 | if(result.cypher == 3){ 151 | $.log(`\n答题王者视频观看成功`) 152 | await $.wait(15000) 153 | await dtwzhb(); 154 | 155 | } else { 156 | 157 | $.log(`\n答题王者视频观看失败:${data}`) 158 | 159 | } 160 | 161 | } catch (e) { 162 | //$.logErr(e, resp); 163 | } finally { 164 | resolve() 165 | } 166 | },timeout) 167 | }) 168 | } 169 | 170 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 171 | -------------------------------------------------------------------------------- /elsbjsb.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:2048极速版 3 | 更新时间:2021-09-27 @YaphetS0903 4 | 脚本说明:2048极速版自动刷红包。。 5 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 6 | 2048极速版使用方法: 7 | 领取红包获得红包数据。 8 | 本脚本以学习为主 9 | TG通知群:https://t.me/tom_ww 10 | TG电报交流群: https://t.me/tom_210120 11 | boxjs地址 : 12 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 13 | 2048极速版 14 | 圈X配置如下,其他软件自行测试 15 | 16 | [task_local] 17 | #2048极速版 18 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 19 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/elsbjsb.js, tag=2048极速版, enabled=true 20 | [rewrite_local] 21 | #2048极速版红包 22 | https://r1.nullpointerexception.cn/redpacket//f/ad/divident url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/elsbjsb.js 23 | [MITM] 24 | hostname = r1.nullpointerexception.cn 25 | */ 26 | const $ = new Env('2048极速版'); 27 | let status; 28 | status = (status = ($.getval("elsbjsbstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 29 | const elsbjsbhdArr = [],elsbjsbbodyArr = [],elsbjsbcount = '' 30 | let elsbjsbhd = $.getdata('elsbjsbhd') 31 | let elsbjsbbody = $.getdata('elsbjsbbody') 32 | 33 | !(async () => { 34 | if (typeof $request !== "undefined") { 35 | await elsbjsbck() 36 | 37 | } else { 38 | elsbjsbhdArr.push($.getdata('elsbjsbhd')) 39 | elsbjsbbodyArr.push($.getdata('elsbjsbbody')) 40 | let elsbjsbcount = ($.getval('elsbjsbcount') || '1'); 41 | for (let i = 2; i <= elsbjsbcount; i++) { 42 | elsbjsbhdArr.push($.getdata(`elsbjsbhd${i}`)) 43 | elsbjsbbodyArr.push($.getdata(`elsbjsbbody${i}`)) 44 | } 45 | console.log(`------------- 共${elsbjsbhdArr.length}个账号-------------\n`) 46 | for (let i = 0; i < elsbjsbhdArr.length; i++) { 47 | if (elsbjsbhdArr[i]) { 48 | elsbjsbhd = elsbjsbhdArr[i]; 49 | elsbjsbbody = elsbjsbbodyArr[i]; 50 | $.index = i + 1; 51 | console.log(`\n开始【2048极速版${$.index}】`) 52 | 53 | 54 | await elsbjsbhb(); 55 | 56 | 57 | 58 | 59 | } 60 | }} 61 | 62 | })() 63 | .catch((e) => $.logErr(e)) 64 | .finally(() => $.done()) 65 | //数据获取 66 | 67 | 68 | function elsbjsbck() { 69 | if ($request.url.indexOf("divident") > -1) { 70 | 71 | const elsbjsbhd = JSON.stringify($request.headers) 72 | if(elsbjsbhd) $.setdata(elsbjsbhd,`elsbjsbhd${status}`) 73 | $.log(elsbjsbhd) 74 | const elsbjsbbody = $request.body 75 | if(elsbjsbbody) $.setdata(elsbjsbbody,`elsbjsbbody${status}`) 76 | $.log(elsbjsbbody) 77 | $.msg($.name,"",'2048极速版'+`${status}` +'红包数据获取成功!') 78 | } 79 | } 80 | 81 | //红包 82 | function elsbjsbhb(timeout = 0) { 83 | return new Promise((resolve) => { 84 | 85 | let url = { 86 | url : 'https://r1.nullpointerexception.cn/redpacket//f/ad/divident', 87 | headers : JSON.parse(elsbjsbhd), 88 | body : elsbjsbbody, 89 | } 90 | $.post(url, async (err, resp, data) => { 91 | try { 92 | //const result = JSON.parse(data) 93 | if(resp.statusCode == 200){ 94 | $.log(`\n2048极速版:成功领取红包`) 95 | } else { 96 | 97 | $.log(`\n2048极速版:领取失败${data}`) 98 | 99 | } 100 | 101 | } catch (e) { 102 | //$.logErr(e, resp); 103 | } finally { 104 | resolve() 105 | } 106 | },timeout) 107 | }) 108 | } 109 | 110 | 111 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 112 | -------------------------------------------------------------------------------- /hmd.js: -------------------------------------------------------------------------------- 1 | /* 2 | ck获取:签到一次获取ck 3 | [MITM] 4 | hostname = b2b.homedo.com 5 | 6 | [task_local] 7 | 2 8 * * * hmd.js, tag=河姆渡签到, enabled=true 8 | 9 | [rewrite_local] 10 | https://b2b.homedo.com/mall-pcweb-compositeservice/bff/customPavilion/ url script-request-body hmd.js 11 | */ 12 | 13 | const $ = new Env('河姆渡签到'); 14 | let status; 15 | status = (status = ($.getval("hmdstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 16 | const hmdurlArr = [], hmdhdArr = [],hmdbodyArr=[],hmdcount = '' 17 | let time = Math.round(Date.now() / 1000) 18 | let hmdurl = $.getdata('hmdurl') 19 | let hmdhd = $.getdata('hmdhd') 20 | let hmdbody = $.getdata('hmdbody') 21 | let hmdkey = '',uid='' 22 | !(async () => { 23 | if (typeof $request !== "undefined") { 24 | await hmdck() 25 | 26 | } else {hmdurlArr.push($.getdata('hmdurl')) 27 | hmdhdArr.push($.getdata('hmdhd')) 28 | hmdbodyArr.push($.getdata('hmdbody')) 29 | let hmdcount = ($.getval('hmdcount') || '1'); 30 | for (let i = 2; i <= hmdcount; i++) { 31 | hmdurlArr.push($.getdata(`hmdurl${i}`)) 32 | hmdhdArr.push($.getdata(`hmdhd${i}`)) 33 | hmdbodyArr.push($.getdata(`hmdbody${i}`)) 34 | } 35 | console.log(`------------- 共${hmdbodyArr.length}个账号-------------\n`) 36 | for (let i = 0; i < hmdbodyArr.length; i++) { 37 | if (hmdbodyArr[i]) { 38 | 39 | hmdurl = hmdurlArr[i]; 40 | hmdhd = hmdhdArr[i]; 41 | hmdbody = hmdbodyArr[i]; 42 | $.index = i + 1; 43 | console.log(`\n开始【河姆渡${$.index}】`) 44 | await $.wait(1000); 45 | await hmdqd(); 46 | 47 | } 48 | }} 49 | })() 50 | .catch((e) => $.logErr(e)) 51 | .finally(() => $.done()) 52 | 53 | function hmdck() { 54 | if ($request.url.indexOf("signinDoTask") > -1) { 55 | const hmdurl = $request.url 56 | if(hmdurl) $.setdata(hmdurl,`hmdurl${status}`) 57 | $.log(hmdurl) 58 | const hmdhd = JSON.stringify($request.headers) 59 | if(hmdhd) $.setdata(hmdhd,`hmdhd${status}`) 60 | $.log(hmdhd) 61 | const hmdbody = $request.body 62 | if (hmdbody) 63 | $.setdata(hmdbody, `hmdbody${status}`) 64 | $.log(hmdbody) 65 | 66 | $.msg($.name,"",`河姆渡获取${status}数据获取成功`) 67 | 68 | } 69 | } 70 | 71 | function hmdqd(timeout = 0) { 72 | return new Promise((resolve) => { 73 | //uid=hmdurl.match(/user_id=(.*?)&/)[1] 74 | let url = { 75 | url : `https://b2b.homedo.com/mall-pcweb-compositeservice/bff/customPavilion/signinDoTask`, 76 | headers : JSON.parse(hmdhd), 77 | body: hmdbody, 78 | } 79 | $.post(url, async (err, resp, data) => { 80 | try { 81 | const result = JSON.parse(data) 82 | if(result.respCode == 0000){ 83 | console.log('\n打卡: '+result.respDesc) 84 | } else { 85 | console.log('\n打卡: '+result.respDesc) 86 | } 87 | 88 | } catch (e) { 89 | //$.logErr(e, resp); 90 | } finally { 91 | resolve() 92 | } 93 | },timeout) 94 | }) 95 | } 96 | 97 | 98 | 99 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 100 | -------------------------------------------------------------------------------- /image/YaphetS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/YaphetS.jpg -------------------------------------------------------------------------------- /image/YaphetS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/YaphetS.png -------------------------------------------------------------------------------- /image/dfhz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/dfhz.png -------------------------------------------------------------------------------- /image/flg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/flg.png -------------------------------------------------------------------------------- /image/flhs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/flhs.png -------------------------------------------------------------------------------- /image/ls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/ls.png -------------------------------------------------------------------------------- /image/ls2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/ls2.png -------------------------------------------------------------------------------- /image/sjb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YaphetS0903/JStest/3afacf7259fba929e703a15593b95daf84b2cc7c/image/sjb.png -------------------------------------------------------------------------------- /kxxxx.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 软件名称:开心消消消 4 | 更新时间:2021-09-27 @YaphetS0903 5 | 脚本说明:开心消消消自动刷红包。。 6 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 7 | 开心消消消使用方法: 8 | 1-点击气泡红包观看广告结束获得视频数据。 9 | 2-领取红包获得红包数据。 10 | 本脚本以学习为主 11 | 12 | TG通知群:https://t.me/tom_ww 13 | TG电报交流群: https://t.me/tom_210120 14 | 15 | boxjs地址 : 16 | 17 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 18 | 19 | 开心消消消 20 | 圈X配置如下,其他软件自行测试 21 | [task_local] 22 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 23 | #开心消消消 24 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/kxxxx.js, tag=开心消消消, enabled=true 25 | [rewrite_local] 26 | #开心消消消视频 27 | https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/ url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/kxxxx.js 28 | #开心消消消红包 29 | https://r1.nullpointerexception.cn/redpacket//f/ad/divident url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/kxxxx.js 30 | [MITM] 31 | hostname = r1.nullpointerexception.cn, api-access.pangolin-sdk-toutiao.com 32 | */ 33 | const $ = new Env('开心消消消'); 34 | let status; 35 | status = (status = ($.getval("kxxxxstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 36 | const kxxxxhdArr = [],kxxxxbodyArr = [],kxxxxspbodyArr = [],kxxxxcount = '' 37 | let kxxxxhd = $.getdata('kxxxxhd') 38 | let kxxxxbody = $.getdata('kxxxxbody') 39 | let kxxxxspbody = $.getdata('kxxxxspbody') 40 | const sphd = { 41 | 'Accept' : `*/*`, 42 | 'Accept-Encoding' : `gzip, deflate, br`, 43 | 'Connection' : `keep-alive`, 44 | 'Content-Type' : `application/json`, 45 | 'Host' : `api-access.pangolin-sdk-toutiao.com`, 46 | 'User-Agent' : `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`, 47 | 'Accept-Language' : `zh-Hans-CN;q=1` 48 | }; 49 | !(async () => { 50 | if (typeof $request !== "undefined") { 51 | await kxxxxck() 52 | 53 | } else { 54 | kxxxxhdArr.push($.getdata('kxxxxhd')) 55 | kxxxxbodyArr.push($.getdata('kxxxxbody')) 56 | kxxxxspbodyArr.push($.getdata('kxxxxspbody')) 57 | let kxxxxcount = ($.getval('kxxxxcount') || '1'); 58 | for (let i = 2; i <= kxxxxcount; i++) { 59 | kxxxxhdArr.push($.getdata(`kxxxxhd${i}`)) 60 | kxxxxbodyArr.push($.getdata(`kxxxxbody${i}`)) 61 | kxxxxspbodyArr.push($.getdata(`kxxxxspbody${i}`)) 62 | } 63 | console.log(`------------- 共${kxxxxhdArr.length}个账号-------------\n`) 64 | for (let i = 0; i < kxxxxhdArr.length; i++) { 65 | if (kxxxxhdArr[i]) { 66 | kxxxxhd = kxxxxhdArr[i]; 67 | kxxxxbody = kxxxxbodyArr[i]; 68 | kxxxxspbody = kxxxxspbodyArr[i]; 69 | $.index = i + 1; 70 | console.log(`\n开始【开心消消消${$.index}】`) 71 | 72 | 73 | await kxxxxsp(); 74 | 75 | 76 | 77 | 78 | } 79 | }} 80 | 81 | })() 82 | .catch((e) => $.logErr(e)) 83 | .finally(() => $.done()) 84 | //数据获取 85 | 86 | 87 | function kxxxxck() { 88 | if ($request.url.indexOf("divident") > -1) { 89 | 90 | const kxxxxhd = JSON.stringify($request.headers) 91 | if(kxxxxhd) $.setdata(kxxxxhd,`kxxxxhd${status}`) 92 | $.log(kxxxxhd) 93 | const kxxxxbody = $request.body 94 | if(kxxxxbody) $.setdata(kxxxxbody,`kxxxxbody${status}`) 95 | $.log(kxxxxbody) 96 | $.msg($.name,"",'开心消消消'+`${status}` +'红包数据获取成功!') 97 | }else if ($request.url.indexOf("reward_video/reward/") > -1) { 98 | 99 | const kxxxxspbody = $request.body 100 | if(kxxxxspbody) $.setdata(kxxxxspbody,`kxxxxspbody${status}`) 101 | $.log(kxxxxspbody) 102 | $.msg($.name,"",'开心消消消'+`${status}` +'视频数据获取成功!') 103 | } 104 | } 105 | 106 | //红包 107 | function kxxxxhb(timeout = 0) { 108 | return new Promise((resolve) => { 109 | 110 | let url = { 111 | url : 'https://r1.nullpointerexception.cn/redpacket//f/ad/divident', 112 | headers : JSON.parse(kxxxxhd), 113 | body : kxxxxbody, 114 | } 115 | $.post(url, async (err, resp, data) => { 116 | try { 117 | //const result = JSON.parse(data) 118 | if(resp.statusCode == 200){ 119 | $.log(`\n开心消消消:成功领取红包`) 120 | } else { 121 | 122 | $.log(`\n开心消消消:领取失败${data}`) 123 | 124 | } 125 | 126 | } catch (e) { 127 | //$.logErr(e, resp); 128 | } finally { 129 | resolve() 130 | } 131 | },timeout) 132 | }) 133 | } 134 | 135 | 136 | function kxxxxsp(timeout = 0) { 137 | return new Promise((resolve) => { 138 | 139 | let url = { 140 | url : 'https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/', 141 | headers : sphd, 142 | body : kxxxxspbody, 143 | } 144 | $.post(url, async (err, resp, data) => { 145 | try { 146 | const result = JSON.parse(data) 147 | if(result.cypher == 3){ 148 | $.log(`\n开心消消消视频观看成功`) 149 | await $.wait(15000) 150 | await kxxxxhb(); 151 | 152 | } else { 153 | 154 | $.log(`\n开心消消消视频观看失败:${data}`) 155 | 156 | } 157 | 158 | } catch (e) { 159 | //$.logErr(e, resp); 160 | } finally { 161 | resolve() 162 | } 163 | },timeout) 164 | }) 165 | } 166 | 167 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 168 | -------------------------------------------------------------------------------- /ppxxx.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 软件名称:泡泡消消消 4 | 更新时间:2021-09-27 @YaphetS0903 5 | 脚本说明:泡泡消消消自动刷红包。。 6 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 7 | 泡泡消消消使用方法: 8 | 1-点击气泡红包观看广告结束获得视频数据。 9 | 2-领取红包获得红包数据。 10 | 本脚本以学习为主 11 | 12 | TG通知群:https://t.me/tom_ww 13 | TG电报交流群: https://t.me/tom_210120 14 | 15 | boxjs地址 : 16 | 17 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 18 | 19 | 泡泡消消消 20 | 圈X配置如下,其他软件自行测试 21 | [task_local] 22 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 23 | #泡泡消消消 24 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/ppxxx.js, tag=泡泡消消消, enabled=true 25 | [rewrite_local] 26 | #泡泡消消消视频 27 | https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/ url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/ppxxx.js 28 | #泡泡消消消红包 29 | https://r1.nullpointerexception.cn/redpacket//f/ad/divident url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/ppxxx.js 30 | [MITM] 31 | hostname = r1.nullpointerexception.cn, api-access.pangolin-sdk-toutiao.com 32 | */ 33 | const $ = new Env('泡泡消消消'); 34 | let status; 35 | status = (status = ($.getval("ppxxxstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 36 | const ppxxxhdArr = [],ppxxxbodyArr = [],ppxxxspbodyArr = [],ppxxxcount = '' 37 | let ppxxxhd = $.getdata('ppxxxhd') 38 | let ppxxxbody = $.getdata('ppxxxbody') 39 | let ppxxxspbody = $.getdata('ppxxxspbody') 40 | const sphd = { 41 | 'Accept' : `*/*`, 42 | 'Accept-Encoding' : `gzip, deflate, br`, 43 | 'Connection' : `keep-alive`, 44 | 'Content-Type' : `application/json`, 45 | 'Host' : `api-access.pangolin-sdk-toutiao.com`, 46 | 'User-Agent' : `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`, 47 | 'Accept-Language' : `zh-Hans-CN;q=1` 48 | }; 49 | !(async () => { 50 | if (typeof $request !== "undefined") { 51 | await ppxxxck() 52 | 53 | } else { 54 | ppxxxhdArr.push($.getdata('ppxxxhd')) 55 | ppxxxbodyArr.push($.getdata('ppxxxbody')) 56 | ppxxxspbodyArr.push($.getdata('ppxxxspbody')) 57 | let ppxxxcount = ($.getval('ppxxxcount') || '1'); 58 | for (let i = 2; i <= ppxxxcount; i++) { 59 | ppxxxhdArr.push($.getdata(`ppxxxhd${i}`)) 60 | ppxxxbodyArr.push($.getdata(`ppxxxbody${i}`)) 61 | ppxxxspbodyArr.push($.getdata(`ppxxxspbody${i}`)) 62 | } 63 | console.log(`------------- 共${ppxxxhdArr.length}个账号-------------\n`) 64 | for (let i = 0; i < ppxxxhdArr.length; i++) { 65 | if (ppxxxhdArr[i]) { 66 | ppxxxhd = ppxxxhdArr[i]; 67 | ppxxxbody = ppxxxbodyArr[i]; 68 | ppxxxspbody = ppxxxspbodyArr[i]; 69 | $.index = i + 1; 70 | console.log(`\n开始【泡泡消消消${$.index}】`) 71 | 72 | 73 | await ppxxxsp(); 74 | 75 | 76 | 77 | 78 | } 79 | }} 80 | 81 | })() 82 | .catch((e) => $.logErr(e)) 83 | .finally(() => $.done()) 84 | //数据获取 85 | 86 | 87 | function ppxxxck() { 88 | if ($request.url.indexOf("divident") > -1) { 89 | 90 | const ppxxxhd = JSON.stringify($request.headers) 91 | if(ppxxxhd) $.setdata(ppxxxhd,`ppxxxhd${status}`) 92 | $.log(ppxxxhd) 93 | const ppxxxbody = $request.body 94 | if(ppxxxbody) $.setdata(ppxxxbody,`ppxxxbody${status}`) 95 | $.log(ppxxxbody) 96 | $.msg($.name,"",'泡泡消消消'+`${status}` +'红包数据获取成功!') 97 | }else if ($request.url.indexOf("reward_video/reward/") > -1) { 98 | 99 | const ppxxxspbody = $request.body 100 | if(ppxxxspbody) $.setdata(ppxxxspbody,`ppxxxspbody${status}`) 101 | $.log(ppxxxspbody) 102 | $.msg($.name,"",'泡泡消消消'+`${status}` +'视频数据获取成功!') 103 | } 104 | } 105 | 106 | //红包 107 | function ppxxxhb(timeout = 0) { 108 | return new Promise((resolve) => { 109 | 110 | let url = { 111 | url : 'https://r1.nullpointerexception.cn/redpacket//f/ad/divident', 112 | headers : JSON.parse(ppxxxhd), 113 | body : ppxxxbody, 114 | } 115 | $.post(url, async (err, resp, data) => { 116 | try { 117 | //const result = JSON.parse(data) 118 | if(resp.statusCode == 200){ 119 | $.log(`\n泡泡消消消:成功领取红包`) 120 | } else { 121 | 122 | $.log(`\n泡泡消消消:领取失败${data}`) 123 | 124 | } 125 | 126 | } catch (e) { 127 | //$.logErr(e, resp); 128 | } finally { 129 | resolve() 130 | } 131 | },timeout) 132 | }) 133 | } 134 | 135 | 136 | function ppxxxsp(timeout = 0) { 137 | return new Promise((resolve) => { 138 | 139 | let url = { 140 | url : 'https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/', 141 | headers : sphd, 142 | body : ppxxxspbody, 143 | } 144 | $.post(url, async (err, resp, data) => { 145 | try { 146 | const result = JSON.parse(data) 147 | if(result.cypher == 3){ 148 | $.log(`\n泡泡消消消视频观看成功`) 149 | await $.wait(15000) 150 | await ppxxxhb(); 151 | 152 | } else { 153 | 154 | $.log(`\n泡泡消消消视频观看失败:${data}`) 155 | 156 | } 157 | 158 | } catch (e) { 159 | //$.logErr(e, resp); 160 | } finally { 161 | resolve() 162 | } 163 | },timeout) 164 | }) 165 | } 166 | 167 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 168 | -------------------------------------------------------------------------------- /ttcg.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:天天猜歌 3 | 更新时间:2021-09-28 @YaphetS0903 4 | 脚本说明:天天猜歌自动刷红包。。 5 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 6 | 天天猜歌使用方法: 7 | 看视频领取红包获得红包数据。 8 | 本脚本以学习为主 9 | TG通知群:https://t.me/tom_ww 10 | TG电报交流群: https://t.me/tom_210120 11 | boxjs地址 : 12 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 13 | 天天猜歌 14 | 圈X配置如下,其他软件自行测试 15 | [task_local] 16 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 17 | #天天猜歌 18 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/ttcg.js, tag=天天猜歌, enabled=true 19 | [rewrite_local] 20 | #天天猜歌红包 21 | https://fly.springglasses.com/api/app/ios/credit/coin? url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/ttcg.js 22 | [MITM] 23 | hostname = fly.springglasses.com 24 | */ 25 | 26 | const $ = new Env('天天猜歌'); 27 | let status; 28 | 29 | status = (status = ($.getval("ttcgstatus") || "1")) > 1 ? `${status}` : ""; 30 | 31 | const ttcgbodyArr = [], ttcgtokenArr = [],ttcgcount = '' 32 | 33 | let ttcgbody = $.getdata('ttcgbody') 34 | let ttcgtoken = $.getdata('ttcgtoken') 35 | 36 | !(async () => { 37 | if (typeof $request !== "undefined") { 38 | 39 | ttcgck() 40 | 41 | } else { 42 | 43 | ttcgbodyArr.push($.getdata('ttcgbody')) 44 | ttcgtokenArr.push($.getdata('ttcgtoken')) 45 | 46 | let ttcgcount = ($.getval('ttcgcount') || '1'); 47 | 48 | for (let i = 2; i <= ttcgcount; i++) { 49 | 50 | ttcgbodyArr.push($.getdata(`ttcgbody${i}`)) 51 | ttcgtokenArr.push($.getdata(`ttcgtoken${i}`)) 52 | 53 | } 54 | 55 | console.log( 56 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 57 | new Date().getTime() + 58 | new Date().getTimezoneOffset() * 60 * 1000 + 59 | 8 * 60 * 60 * 1000 60 | ).toLocaleString()} ===============================================`); 61 | 62 | for (let i = 0; i < ttcgtokenArr.length; i++) { 63 | 64 | if (ttcgtokenArr[i]) { 65 | 66 | ttcgbody = ttcgbodyArr[i]; 67 | ttcgtoken = ttcgtokenArr[i]; 68 | 69 | $.index = i + 1; 70 | console.log(`\n\n天天猜歌【共有${ttcgtokenArr.length}个账号】`) 71 | console.log(`\n\n开始【执行第${$.index}个号刷视频】`) 72 | for(let j=0; j<5; j++){ 73 | let sjTimes = randomNum(30000,35000) 74 | randomtime = sjTimes/1000 75 | console.log(`开始第${j+1}次刷红包`) 76 | await sphb() 77 | console.log(`随机延迟${randomtime}秒`) 78 | await $.wait(sjTimes) 79 | 80 | } 81 | } 82 | } 83 | } 84 | })() 85 | 86 | .catch((e) => $.logErr(e)) 87 | .finally(() => $.done()) 88 | 89 | 90 | //获取ck函数 91 | function ttcgck() { 92 | if ($request.url.indexOf("app/ios") > -1 && $request.url.indexOf("credit/coin") > -1) { 93 | 94 | const ttcgbody = $request.body 95 | if (ttcgbody) $.setdata(ttcgbody, `ttcgbody${status}`) 96 | $.log(ttcgbody) 97 | 98 | const ttcgtoken = $request.headers.token 99 | if (ttcgtoken) $.setdata(ttcgtoken, `ttcgtoken${status}`) 100 | $.log(ttcgtoken) 101 | 102 | 103 | $.msg($.name, "", `视频headers${status}获取成功`) 104 | 105 | 106 | } 107 | } 108 | 109 | 110 | 111 | 112 | //刷视频函数 113 | function sphb(timeout = 0) { 114 | return new Promise((resolve) => { 115 | const newTimes = new Date().getTime(); 116 | let url = { 117 | url: "https://fly.springglasses.com/api/app/ios/credit/coin?"+newTimes, 118 | headers: { 119 | "Connection":"keep-alive", 120 | "Content-Type":"application/json;charset=utf-8", 121 | "Host":"speedcy.springglasses.com", 122 | "User-Agent":"iPhone Client", 123 | "token":ttcgtoken 124 | }, 125 | body: ttcgbody, 126 | }; 127 | $.post(url, async (err, resp, data) => { 128 | try { 129 | 130 | data = data 131 | if (data && data.length >= 364) { 132 | 133 | console.log("刷视频成功"); 134 | 135 | } else { 136 | 137 | console.log("刷视频失败"); 138 | 139 | } 140 | } catch (e) { 141 | 142 | } finally { 143 | 144 | resolve() 145 | } 146 | }, timeout) 147 | }) 148 | } 149 | 150 | //延时函数 151 | function randomNum(minNum,maxNum){ 152 | switch(arguments.length){ 153 | case 1: 154 | return parseInt(Math.random()*minNum+1); 155 | break; 156 | case 2: 157 | return parseInt(Math.random()*(maxNum-minNum+1)+minNum); 158 | break; 159 | default: 160 | return 0; 161 | break; 162 | } 163 | } 164 | 165 | 166 | 167 | //env模块 不要动 168 | function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } 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) } 169 | -------------------------------------------------------------------------------- /ttdt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:天天答题 3 | 更新时间:2021-09-28 @YaphetS0903 4 | 脚本说明:天天答题自动刷红包。。 5 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 6 | 天天答题使用方法: 7 | 看视频领取红包获得红包数据。 8 | 本脚本以学习为主 9 | TG通知群:https://t.me/tom_ww 10 | TG电报交流群: https://t.me/tom_210120 11 | boxjs地址 : 12 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 13 | 天天答题 14 | 圈X配置如下,其他软件自行测试 15 | [task_local] 16 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 17 | #天天答题 18 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/ttdt.js, tag=天天答题, enabled=true 19 | [rewrite_local] 20 | #天天答题红包 21 | https://speeddati.springglasses.com/api/app/ios/credit/coin? url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/ttdt.js 22 | [MITM] 23 | hostname = speeddati.springglasses.com 24 | */ 25 | 26 | const $ = new Env('天天答题'); 27 | let status; 28 | 29 | status = (status = ($.getval("ttdtstatus") || "1")) > 1 ? `${status}` : ""; 30 | 31 | const ttdtbodyArr = [], ttdttokenArr = [],ttdtcount = '' 32 | 33 | let ttdtbody = $.getdata('ttdtbody') 34 | let ttdttoken = $.getdata('ttdttoken') 35 | 36 | !(async () => { 37 | if (typeof $request !== "undefined") { 38 | 39 | ttdtck() 40 | 41 | } else { 42 | 43 | ttdtbodyArr.push($.getdata('ttdtbody')) 44 | ttdttokenArr.push($.getdata('ttdttoken')) 45 | 46 | let ttdtcount = ($.getval('ttdtcount') || '1'); 47 | 48 | for (let i = 2; i <= ttdtcount; i++) { 49 | 50 | ttdtbodyArr.push($.getdata(`ttdtbody${i}`)) 51 | ttdttokenArr.push($.getdata(`ttdttoken${i}`)) 52 | 53 | } 54 | 55 | console.log( 56 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 57 | new Date().getTime() + 58 | new Date().getTimezoneOffset() * 60 * 1000 + 59 | 8 * 60 * 60 * 1000 60 | ).toLocaleString()} ===============================================`); 61 | 62 | for (let i = 0; i < ttdttokenArr.length; i++) { 63 | 64 | if (ttdttokenArr[i]) { 65 | 66 | ttdtbody = ttdtbodyArr[i]; 67 | ttdttoken = ttdttokenArr[i]; 68 | 69 | $.index = i + 1; 70 | console.log(`\n\n天天答题【共有${ttdttokenArr.length}个账号】`) 71 | console.log(`\n\n开始【执行第${$.index}个号刷视频】`) 72 | for(let j=0; j<5; j++){ 73 | let sjTimes = randomNum(30000,35000) 74 | randomtime = sjTimes/1000 75 | console.log(`开始第${j+1}次刷红包`) 76 | await sphb() 77 | console.log(`随机延迟${randomtime}秒`) 78 | await $.wait(sjTimes) 79 | 80 | } 81 | } 82 | } 83 | } 84 | })() 85 | 86 | .catch((e) => $.logErr(e)) 87 | .finally(() => $.done()) 88 | 89 | 90 | //获取ck函数 91 | function ttdtck() { 92 | if ($request.url.indexOf("app/ios") > -1 && $request.url.indexOf("credit/coin") > -1) { 93 | 94 | const ttdtbody = $request.body 95 | if (ttdtbody) $.setdata(ttdtbody, `ttdtbody${status}`) 96 | $.log(ttdtbody) 97 | 98 | const ttdttoken = $request.headers.token 99 | if (ttdttoken) $.setdata(ttdttoken, `ttdttoken${status}`) 100 | $.log(ttdttoken) 101 | 102 | 103 | $.msg($.name, "", `视频headers${status}获取成功`) 104 | 105 | 106 | } 107 | } 108 | 109 | 110 | 111 | 112 | //刷视频函数 113 | function sphb(timeout = 0) { 114 | return new Promise((resolve) => { 115 | const newTimes = new Date().getTime(); 116 | let url = { 117 | url: "https://speeddati.springglasses.com/api/app/ios/credit/coin?"+newTimes, 118 | headers: { 119 | "Connection":"keep-alive", 120 | "Content-Type":"application/json;charset=utf-8", 121 | "Host":"speedcy.springglasses.com", 122 | "User-Agent":"iPhone Client", 123 | "token":ttdttoken 124 | }, 125 | body: ttdtbody, 126 | }; 127 | $.post(url, async (err, resp, data) => { 128 | try { 129 | 130 | data = data 131 | if (data && data.length >= 364) { 132 | 133 | console.log("刷视频成功"); 134 | 135 | } else { 136 | 137 | console.log("刷视频失败"); 138 | 139 | } 140 | } catch (e) { 141 | 142 | } finally { 143 | 144 | resolve() 145 | } 146 | }, timeout) 147 | }) 148 | } 149 | 150 | //延时函数 151 | function randomNum(minNum,maxNum){ 152 | switch(arguments.length){ 153 | case 1: 154 | return parseInt(Math.random()*minNum+1); 155 | break; 156 | case 2: 157 | return parseInt(Math.random()*(maxNum-minNum+1)+minNum); 158 | break; 159 | default: 160 | return 0; 161 | break; 162 | } 163 | } 164 | 165 | 166 | 167 | //env模块 不要动 168 | function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } 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) } 169 | -------------------------------------------------------------------------------- /ttxfk.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:天天消方块 3 | 更新时间:2021-09-27 @YaphetS0903 4 | 脚本说明:天天消方块自动刷红包。。 5 | 玩法和其他游戏一样。先把其他游戏的重写关了。。。 6 | 天天消方块使用方法: 7 | 领取红包获得红包数据。 8 | 本脚本以学习为主 9 | TG通知群:https://t.me/tom_ww 10 | TG电报交流群: https://t.me/tom_210120 11 | boxjs地址 : 12 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 13 | 天天消方块 14 | 圈X配置如下,其他软件自行测试 15 | [task_local] 16 | 自行设置运行时间,可设置5分钟到10分钟一次,别太快,垃圾游戏容易黑 17 | #天天消方块 18 | 0,30 * 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/ttxfk.js, tag=天天消方块, enabled=true 19 | [rewrite_local] 20 | #天天消方块红包 21 | https://num.springglasses.com/api/app/ios/credit/coin? url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/ttxfk.js 22 | [MITM] 23 | hostname = num.springglasses.com 24 | */ 25 | 26 | const $ = new Env('天天消方块'); 27 | let status; 28 | 29 | status = (status = ($.getval("ttxfkstatus") || "1")) > 1 ? `${status}` : ""; 30 | 31 | const ttxfkbodyArr = [], ttxfktokenArr = [],ttxfkcount = '' 32 | 33 | let ttxfkbody = $.getdata('ttxfkbody') 34 | let ttxfktoken = $.getdata('ttxfktoken') 35 | 36 | !(async () => { 37 | if (typeof $request !== "undefined") { 38 | 39 | ttxfkck() 40 | 41 | } else { 42 | 43 | ttxfkbodyArr.push($.getdata('ttxfkbody')) 44 | ttxfktokenArr.push($.getdata('ttxfktoken')) 45 | 46 | let ttxfkcount = ($.getval('ttxfkcount') || '1'); 47 | 48 | for (let i = 2; i <= ttxfkcount; i++) { 49 | 50 | ttxfkbodyArr.push($.getdata(`ttxfkbody${i}`)) 51 | ttxfktokenArr.push($.getdata(`ttxfktoken${i}`)) 52 | 53 | } 54 | 55 | console.log( 56 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 57 | new Date().getTime() + 58 | new Date().getTimezoneOffset() * 60 * 1000 + 59 | 8 * 60 * 60 * 1000 60 | ).toLocaleString()} ===============================================`); 61 | 62 | for (let i = 0; i < ttxfktokenArr.length; i++) { 63 | 64 | if (ttxfktokenArr[i]) { 65 | 66 | ttxfkbody = ttxfkbodyArr[i]; 67 | ttxfktoken = ttxfktokenArr[i]; 68 | 69 | $.index = i + 1; 70 | console.log(`\n\n天天消方块【共有${ttxfktokenArr.length}个账号】`) 71 | console.log(`\n\n开始【执行第${$.index}个号刷视频】`) 72 | for(let j=0; j<5; j++){ 73 | let sjTimes = randomNum(30000,35000) 74 | randomtime = sjTimes/1000 75 | console.log(`开始第${j+1}次刷红包`) 76 | await sphb() 77 | console.log(`随机延迟${randomtime}秒`) 78 | await $.wait(sjTimes) 79 | 80 | } 81 | } 82 | } 83 | } 84 | })() 85 | 86 | .catch((e) => $.logErr(e)) 87 | .finally(() => $.done()) 88 | 89 | 90 | //获取ck函数 91 | function ttxfkck() { 92 | if ($request.url.indexOf("app/ios") > -1 && $request.url.indexOf("credit/coin") > -1) { 93 | 94 | const ttxfkbody = $request.body 95 | if (ttxfkbody) $.setdata(ttxfkbody, `ttxfkbody${status}`) 96 | $.log(ttxfkbody) 97 | 98 | const ttxfktoken = $request.headers.token 99 | if (ttxfktoken) $.setdata(ttxfktoken, `ttxfktoken${status}`) 100 | $.log(ttxfktoken) 101 | 102 | 103 | $.msg($.name, "", `视频headers${status}获取成功`) 104 | 105 | 106 | } 107 | } 108 | 109 | 110 | 111 | 112 | //刷视频函数 113 | function sphb(timeout = 0) { 114 | return new Promise((resolve) => { 115 | const newTimes = new Date().getTime(); 116 | let url = { 117 | url: "https://num.springglasses.com/api/app/ios/credit/coin?"+newTimes, 118 | headers: { 119 | "Connection":"keep-alive", 120 | "Content-Type":"application/json;charset=utf-8", 121 | "Host":"speedcy.springglasses.com", 122 | "User-Agent":"iPhone Client", 123 | "token":ttxfktoken 124 | }, 125 | body: ttxfkbody, 126 | }; 127 | $.post(url, async (err, resp, data) => { 128 | try { 129 | 130 | data = data 131 | if (data && data.length >= 364) { 132 | 133 | console.log("刷视频成功"); 134 | 135 | } else { 136 | 137 | console.log("刷视频失败"); 138 | 139 | } 140 | } catch (e) { 141 | 142 | } finally { 143 | 144 | resolve() 145 | } 146 | }, timeout) 147 | }) 148 | } 149 | 150 | //延时函数 151 | function randomNum(minNum,maxNum){ 152 | switch(arguments.length){ 153 | case 1: 154 | return parseInt(Math.random()*minNum+1); 155 | break; 156 | case 2: 157 | return parseInt(Math.random()*(maxNum-minNum+1)+minNum); 158 | break; 159 | default: 160 | return 0; 161 | break; 162 | } 163 | } 164 | 165 | 166 | 167 | //env模块 不要动 168 | function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } 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) } 169 | -------------------------------------------------------------------------------- /wzxyjkdk.js: -------------------------------------------------------------------------------- 1 | //我在校园打卡 2 | //制作日期2021.8.1 3 | //rewrite local 4 | //https://student.wozaixiaoyuan.com/health url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/wzxydk.js 5 | //task local 6 | //0 0,10 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/wzxydk.js, tag=我在校园打卡, enabled=true 7 | //hostname=student.wozaixiaoyuan.com 8 | //获取ck方法,打开我在校园,点击健康打卡,获取位置,打卡一次获取ck 9 | 10 | 11 | 12 | const $ = new Env('我在校园健康打卡'); 13 | let status; 14 | status = (status = ($.getval("wzxyjkdkstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 15 | const wzxyjkdkurlArr = [], wzxyjkdkhdArr = [],wzxyjkdkbodyArr=[],wzxyjkdkcount = '' 16 | let time = Math.round(Date.now() / 1000) 17 | let wzxyjkdkurl = $.getdata('wzxyjkdkurl') 18 | let wzxyjkdkhd = $.getdata('wzxyjkdkhd') 19 | let wzxyjkdkbody = $.getdata('wzxyjkdkbody') 20 | let wzxyjkdkkey = '',uid='' 21 | !(async () => { 22 | if (typeof $request !== "undefined") { 23 | await wzxyjkdkck() 24 | 25 | } else {wzxyjkdkurlArr.push($.getdata('wzxyjkdkurl')) 26 | wzxyjkdkhdArr.push($.getdata('wzxyjkdkhd')) 27 | wzxyjkdkbodyArr.push($.getdata('wzxyjkdkbody')) 28 | let wzxyjkdkcount = ($.getval('wzxyjkdkcount') || '1'); 29 | for (let i = 2; i <= wzxyjkdkcount; i++) { 30 | wzxyjkdkurlArr.push($.getdata(`wzxyjkdkurl${i}`)) 31 | wzxyjkdkhdArr.push($.getdata(`wzxyjkdkhd${i}`)) 32 | wzxyjkdkbodyArr.push($.getdata(`wzxyjkdkbody${i}`)) 33 | } 34 | console.log(`------------- 共${wzxyjkdkhdArr.length}个账号-------------\n`) 35 | for (let i = 0; i < wzxyjkdkhdArr.length; i++) { 36 | if (wzxyjkdkhdArr[i]) { 37 | 38 | wzxyjkdkurl = wzxyjkdkurlArr[i]; 39 | wzxyjkdkhd = wzxyjkdkhdArr[i]; 40 | wzxyjkdkbody = wzxyjkdkbodyArr[i]; 41 | $.index = i + 1; 42 | console.log(`\n开始【我在校园健康打卡${$.index}】`) 43 | await $.wait(1000); 44 | await wzxyjkdkjs(); 45 | 46 | } 47 | }} 48 | })() 49 | .catch((e) => $.logErr(e)) 50 | .finally(() => $.done()) 51 | 52 | function wzxyjkdkck() { 53 | if ($request.url.indexOf("save.json") > -1) { 54 | const wzxyjkdkurl = $request.url 55 | if(wzxyjkdkurl) $.setdata(wzxyjkdkurl,`wzxyjkdkurl${status}`) 56 | $.log(wzxyjkdkurl) 57 | const wzxyjkdkhd = JSON.stringify($request.headers) 58 | if(wzxyjkdkhd) $.setdata(wzxyjkdkhd,`wzxyjkdkhd${status}`) 59 | $.log(wzxyjkdkhd) 60 | const wzxyjkdkbody = $request.body 61 | if (wzxyjkdkbody) 62 | $.setdata(wzxyjkdkbody, `wzxyjkdkbody${status}`) 63 | $.log(wzxyjkdkbody) 64 | 65 | $.msg($.name,"",`我在校园健康打卡获取${status}数据获取成功`) 66 | 67 | } 68 | } 69 | 70 | function wzxyjkdkjs(timeout = 0) { 71 | return new Promise((resolve) => { 72 | //uid=wzxyjkdkurl.match(/user_id=(.*?)&/)[1] 73 | let url = { 74 | url : `https://student.wozaixiaoyuan.com/health/save.json`, 75 | headers : JSON.parse(wzxyjkdkhd), 76 | body: wzxyjkdkbody, 77 | } 78 | $.post(url, async (err, resp, data) => { 79 | try { 80 | const result = JSON.parse(data) 81 | if(result.code == 0){ 82 | console.log('\n我在校园健康打卡成功 ') 83 | $.msg($.name,"",`我在校园健康打卡成功`) 84 | } else{ 85 | console.log('\n打卡失败: '+result.message) 86 | $.msg($.name,"",`我在校园健康打卡失败`) 87 | } 88 | } catch (e) { 89 | //$.logErr(e, resp); 90 | } finally { 91 | resolve() 92 | } 93 | },timeout) 94 | }) 95 | } 96 | 97 | 98 | 99 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 100 | 101 | -------------------------------------------------------------------------------- /wzxyrjrb.js: -------------------------------------------------------------------------------- 1 | /* 2 | //我在校园日检日报打卡 3 | //制作日期2021.8.31 4 | //打卡ck有效期待测试 5 | //rewrite local 6 | //https://student.wozaixiaoyuan.com/heat url script-request-body https://raw.githubusercontent.com/YaphetS0903/JStest/main/wzxyrjrb.js 7 | //task local 8 | //0 20 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/wzxyrjrb.js, tag=我在校园日检日报打卡, enabled=true 9 | //hostname=student.wozaixiaoyuan.com 10 | //获取ck方法,打开我在校园,点击日检日报,填好所有温度之后,点获取位置,打卡一次获取ck 11 | */ 12 | 13 | const $ = new Env('我在校园日检日报'); 14 | let status; 15 | status = (status = ($.getval("xsgstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 16 | const xsgurlArr = [], xsghdArr = [],xsgbodyArr=[],xsgcount = '' 17 | let time = Math.round(Date.now() / 1000) 18 | let xsgurl = $.getdata('xsgurl') 19 | let xsghd = $.getdata('xsghd') 20 | let xsgbody = $.getdata('xsgbody') 21 | let xsgkey = '',uid='' 22 | !(async () => { 23 | if (typeof $request !== "undefined") { 24 | await xsgck() 25 | 26 | } else {xsgurlArr.push($.getdata('xsgurl')) 27 | xsghdArr.push($.getdata('xsghd')) 28 | xsgbodyArr.push($.getdata('xsgbody')) 29 | let xsgcount = ($.getval('xsgcount') || '1'); 30 | for (let i = 2; i <= xsgcount; i++) { 31 | xsgurlArr.push($.getdata(`xsgurl${i}`)) 32 | xsghdArr.push($.getdata(`xsghd${i}`)) 33 | xsgbodyArr.push($.getdata(`xsgbody${i}`)) 34 | } 35 | console.log(`------------- 共${xsghdArr.length}个账号-------------\n`) 36 | for (let i = 0; i < xsghdArr.length; i++) { 37 | if (xsghdArr[i]) { 38 | 39 | xsgurl = xsgurlArr[i]; 40 | xsghd = xsghdArr[i]; 41 | xsgbody = xsgbodyArr[i]; 42 | $.index = i + 1; 43 | console.log(`\n开始【我在校园日检日报${$.index}】`) 44 | await $.wait(1000); 45 | await xsgjs(); 46 | 47 | } 48 | }} 49 | })() 50 | .catch((e) => $.logErr(e)) 51 | .finally(() => $.done()) 52 | 53 | function xsgck() { 54 | if ($request.url.indexOf("save.json") > -1) { 55 | const xsgurl = $request.url 56 | if(xsgurl) $.setdata(xsgurl,`xsgurl${status}`) 57 | $.log(xsgurl) 58 | const xsghd = JSON.stringify($request.headers) 59 | if(xsghd) $.setdata(xsghd,`xsghd${status}`) 60 | $.log(xsghd) 61 | const xsgbody = $request.body 62 | if (xsgbody) 63 | $.setdata(xsgbody, `xsgbody${status}`) 64 | $.log(xsgbody) 65 | 66 | $.msg($.name,"",`我在校园日检日报获取${status}数据获取成功`) 67 | 68 | } 69 | } 70 | 71 | function xsgjs(timeout = 0) { 72 | return new Promise((resolve) => { 73 | //uid=xsgurl.match(/user_id=(.*?)&/)[1] 74 | let url = { 75 | url : `https://student.wozaixiaoyuan.com/heat/save.json`, 76 | headers : JSON.parse(xsghd), 77 | body: xsgbody, 78 | } 79 | $.post(url, async (err, resp, data) => { 80 | try { 81 | const result = JSON.parse(data) 82 | if(result.code == 0){ 83 | console.log('\n打卡成功 ') 84 | $.msg($.name,"",`我在校园日检日报打卡成功`) 85 | } else{ 86 | console.log('\n打卡失败: '+result.message) 87 | $.msg($.name,"",`我在校园日检日报打卡失败`) 88 | } 89 | } catch (e) { 90 | //$.logErr(e, resp); 91 | } finally { 92 | resolve() 93 | } 94 | },timeout) 95 | }) 96 | } 97 | 98 | 99 | 100 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 101 | -------------------------------------------------------------------------------- /zfxs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:追疯小说 3 | 更新时间:2021-10-26 @YaphetS0903 4 | 脚本说明:追疯小说。。。下载地址,appstore搜索下载 5 | 小毛,一天一毛三到一毛五,10元提现 6 | 刷时长一次30-40分钟,不能连着刷,中间隔30-40分钟刷 7 | 本脚本以学习为主 8 | 获取数据: 点击福利获取数据 9 | TG通知群:https://t.me/tom_ww 10 | TG电报交流群: https://t.me/tom_210120 11 | boxjs地址 : 12 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 13 | 追疯小说 14 | 青龙环境抓取链接https://book.beiyinapp.com/app/welfare/index 15 | 环境配置(@隔开,json格式)export zfxshd='抓取的header1@抓取的header2' 16 | 追疯小说极速版 17 | 圈X配置如下,其他自行测试 18 | [task_local] 19 | #追疯小说 20 | 10 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/zfxs.js, tag=追疯小说, enabled=true 21 | [rewrite_local] 22 | #追疯小说 23 | https://book.beiyinapp.com/app/welfare/index url script-request-header https://raw.githubusercontent.com/YaphetS0903/JStest/main/zfxs.js 24 | [MITM] 25 | hostname = book.beiyinapp.com 26 | */ 27 | const $ = new Env('追疯小说'); 28 | let status; 29 | 30 | status = (status = ($.getval("zfxsstatus") || "1")) > 1 ? `${status}` : ""; 31 | let zfxsurlArr = [], zfxshdArr = [], zfxscount = '' 32 | let zfxsurl = $.getdata('zfxsurl') 33 | let zfxshd= $.isNode() ? (process.env.zfxshd ? process.env.zfxshd : "") : ($.getdata('zfxshd') ? $.getdata('zfxshd') : "") 34 | 35 | let b = Math.round(new Date().getTime() / 1000).toString(); 36 | let DD = RT(0, 999) 37 | let PP = RT(25, 35) 38 | let tz = ($.getval('tz') || '1'); 39 | let tx = ($.getval('tx') || '1'); 40 | let id = '', txid = '', ppid = '', amt = '', redid2 = '', redid = '' 41 | let target = '' 42 | $.message = '' 43 | let zfxshds = "" 44 | 45 | 46 | 47 | 48 | !(async () => { 49 | if (typeof $request !== "undefined") { 50 | await zfxsck() 51 | } else { 52 | if(!$.isNode()){ 53 | zfxsurlArr.push($.getdata('zfxsurl')) 54 | zfxshdArr.push($.getdata('zfxshd')) 55 | 56 | let zfxscount = ($.getval('zfxscount') || '1'); 57 | for (let i = 2; i <= zfxscount; i++) { 58 | zfxsurlArr.push($.getdata(`zfxsurl${i}`)) 59 | zfxshdArr.push($.getdata(`zfxshd${i}`)) 60 | 61 | } 62 | console.log( 63 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 64 | new Date().getTime() + 65 | new Date().getTimezoneOffset() * 60 * 1000 + 66 | 8 * 60 * 60 * 1000 67 | ).toLocaleString()} ===============================================\n`); 68 | for (let i = 0; i < zfxshdArr.length; i++) { 69 | if (zfxshdArr[i]) { 70 | 71 | zfxsurl = zfxsurlArr[i]; 72 | zfxshd = zfxshdArr[i]; 73 | 74 | 75 | $.index = i + 1; 76 | console.log(`\n\n开始【追疯小说${$.index},运行成功。】`) 77 | 78 | await zfxssignpd()//签到 79 | await $.wait(3000) 80 | 81 | await zfxsid() 82 | await $.wait(5000) 83 | 84 | 85 | await zfxstime()//砍价 86 | await $.wait(3000) 87 | 88 | 89 | message() 90 | } 91 | } 92 | }else { 93 | if (process.env.zfxshd && process.env.zfxshd.indexOf('@') > -1) { 94 | zfxshdArr = process.env.zfxshd.split('@'); 95 | console.log(`您选择的是用"@"隔开\n`) 96 | } else { 97 | zfxshds = [process.env.zfxshd] 98 | }; 99 | Object.keys(zfxshds).forEach((item) => { 100 | if (zfxshds[item]) { 101 | zfxshdArr.push(zfxshds[item]) 102 | } 103 | }) 104 | console.log(`共${zfxshdArr.length}个cookie`) 105 | for (let k = 0; k < zfxshdArr.length; k++) { 106 | $.message = "" 107 | zfxshd = zfxshdArr[k] 108 | $.index = k + 1; 109 | console.log(`\n开始【追疯小说${$.index}】运行成功。`) 110 | await zfxssignpd()//签到 111 | await $.wait(3000) 112 | 113 | await zfxsid() 114 | await $.wait(5000) 115 | 116 | 117 | await zfxstime()//砍价 118 | await $.wait(3000) 119 | message() 120 | } 121 | } 122 | 123 | } 124 | })() 125 | 126 | .catch((e) => $.logErr(e)) 127 | .finally(() => $.done()) 128 | 129 | 130 | 131 | 132 | function zfxsck() { 133 | if ($request.url.indexOf("welfare/index") > -1) { 134 | const zfxsurl = $request.url 135 | if (zfxsurl) $.setdata(zfxsurl, `zfxsurl${status}`) 136 | $.log(zfxsurl) 137 | 138 | const zfxshd = JSON.stringify($request.headers) 139 | if (zfxshd) $.setdata(zfxshd, `zfxshd${status}`) 140 | $.log(zfxshd) 141 | 142 | 143 | 144 | $.msg($.name, "", `追疯小说${status}获取数据成功`) 145 | 146 | } 147 | } 148 | 149 | //签到判断 150 | function zfxssignpd(timeout = 0) { 151 | return new Promise((resolve) => { 152 | 153 | let url = { 154 | url: `https://book.beiyinapp.com/app/welfare/my`, 155 | headers: JSON.parse(zfxshd), 156 | 157 | } 158 | $.get(url, async (err, resp, data) => { 159 | try { 160 | 161 | const result = JSON.parse(data) 162 | 163 | if (result.status == 200) { 164 | if(result.data.todaysignin ==1){ 165 | console.log(`【今日已签到】\n`) 166 | console.log(`【连续签到天数】:${result.data.continuitySigninDays}\n`) 167 | console.log(`【今日签到获得金币】:${result.data.todaysignincan}\n`) 168 | console.log(`【明日签到获得金币】:${result.data.tomorrowgold}\n`) 169 | console.log(`【当前金币余额】:${result.data.gold}\n`) 170 | 171 | $.message += `【今日已签到】\n` 172 | $.message += `【连续签到天数】:${result.data.continuitySigninDays}\n` 173 | $.message += `【今日签到获得金币】:${result.data.todaysignincan}\n` 174 | $.message += `【明日签到获得金币】:${result.data.tomorrowgold}\n` 175 | $.message += `【当前金币余额】:${result.data.gold}\n` 176 | }else{ 177 | await $.wait(10000) 178 | await zfxssign() 179 | } 180 | 181 | 182 | 183 | } else { 184 | 185 | console.log(`【签到失败】:${result.message}\n`) 186 | 187 | } 188 | } catch (e) { 189 | 190 | } finally { 191 | 192 | resolve() 193 | } 194 | }, timeout) 195 | }) 196 | } 197 | 198 | 199 | //签到 200 | function zfxssign(timeout = 0) { 201 | return new Promise((resolve) => { 202 | 203 | let url = { 204 | url: `https://book.beiyinapp.com/app/welfare/signin`, 205 | headers: JSON.parse(zfxshd), 206 | 207 | } 208 | $.get(url, async (err, resp, data) => { 209 | try { 210 | 211 | const result = JSON.parse(data) 212 | 213 | if (result.status == 200) { 214 | 215 | console.log(`【签到】:${result.message}\n`) 216 | console.log(`【签到获得金币】:${result.data.gold}\n`) 217 | 218 | await $.wait(10000) 219 | await zfxssigndb() 220 | 221 | 222 | } else { 223 | 224 | console.log(`【签到失败】:${result.message}\n`) 225 | 226 | } 227 | } catch (e) { 228 | 229 | } finally { 230 | 231 | resolve() 232 | } 233 | }, timeout) 234 | }) 235 | } 236 | 237 | 238 | 239 | 240 | //签到翻倍 241 | function zfxssigndb(timeout = 0) { 242 | return new Promise((resolve) => { 243 | 244 | let url = { 245 | url: `https://book.beiyinapp.com/app/Welfare/CompleteRewardVideoADActivity`, 246 | headers: JSON.parse(zfxshd), 247 | body: `type=1 248 | & 249 | welfare_id=0`, 250 | } 251 | $.post(url, async (err, resp, data) => { 252 | try { 253 | 254 | const result = JSON.parse(data) 255 | 256 | if (result.status == 200) { 257 | 258 | console.log(`【签到翻倍】:${result.message}\n`) 259 | console.log(`【签到翻倍获得金币】:${result.data.gold}\n`) 260 | 261 | } else { 262 | 263 | console.log(`【签到翻倍失败】:${result.message}\n`) 264 | 265 | } 266 | } catch (e) { 267 | 268 | } finally { 269 | 270 | resolve() 271 | } 272 | }, timeout) 273 | }) 274 | } 275 | 276 | 277 | 278 | //拆红包id获取 279 | function zfxsid(timeout = 0) { 280 | return new Promise((resolve) => { 281 | 282 | let url = { 283 | url: `https://book.beiyinapp.com/app/welfare/redPacket`, 284 | headers: JSON.parse(zfxshd), 285 | 286 | } 287 | $.post(url, async (err, resp, data) => { 288 | try { 289 | 290 | const result = JSON.parse(data) 291 | 292 | if (result.status == 200) { 293 | 294 | console.log(`【获得拆红包id】:${result.data[2].id}\n`) 295 | redid =result.data[2].id 296 | await $.wait(2000) 297 | await zfxsredinfo() 298 | 299 | 300 | 301 | } else { 302 | 303 | console.log(`【查询拆红包id失败】:${result.message}\n`) 304 | 305 | } 306 | } catch (e) { 307 | 308 | } finally { 309 | 310 | resolve() 311 | } 312 | }, timeout) 313 | }) 314 | } 315 | 316 | 317 | 318 | //拆红包信息 319 | function zfxsredinfo(timeout = 0) { 320 | return new Promise((resolve) => { 321 | 322 | let url = { 323 | url: `https://book.beiyinapp.com/app/welfare/getRedPacketList?id=${redid}`, 324 | headers: JSON.parse(zfxshd), 325 | 326 | } 327 | $.get(url, async (err, resp, data) => { 328 | try { 329 | 330 | const result = JSON.parse(data) 331 | 332 | if (result.status == 200) { 333 | 334 | console.log(`【查询拆红包信息】:${result.message}\n`) 335 | for(let p=0;p<4;p++){ 336 | redid2=result.data[p].id 337 | if(result.data[p].status ==0){ 338 | await $.wait(5000) 339 | await zfxsred(redid2) 340 | await $.wait(10000) 341 | }else{ 342 | console.log(`【此红包已拆】\n`) 343 | } 344 | } 345 | 346 | } else { 347 | 348 | console.log(`【查询拆红包信息失败】:${result.message}\n`) 349 | 350 | } 351 | } catch (e) { 352 | 353 | } finally { 354 | 355 | resolve() 356 | } 357 | }, timeout) 358 | }) 359 | } 360 | 361 | 362 | 363 | //拆红包 364 | function zfxsred(timeout = 0) { 365 | return new Promise((resolve) => { 366 | 367 | let url = { 368 | url: `https://book.beiyinapp.com/app/welfare/openRedPacket`, 369 | headers: JSON.parse(zfxshd), 370 | body: `id=${redid2}`, 371 | } 372 | $.post(url, async (err, resp, data) => { 373 | try { 374 | 375 | const result = JSON.parse(data) 376 | 377 | if (result.status == 200) { 378 | 379 | console.log(`【拆红包】:${result.message}\n`) 380 | } else { 381 | 382 | console.log(`【拆红包失败】:${result.message}\n`) 383 | 384 | } 385 | } catch (e) { 386 | 387 | } finally { 388 | 389 | resolve() 390 | } 391 | }, timeout) 392 | }) 393 | } 394 | 395 | 396 | //刷时长 397 | function zfxstime (timeout = 0) { 398 | return new Promise((resolve) => { 399 | const zfxstimebody=`book_id=4140&number=${DD}&read_time=${PP}&speed=6.000000` 400 | let url = { 401 | url: `https://book.beiyinapp.com/app/UserReadHistory/ReadRecord`, 402 | headers: JSON.parse(zfxshd), 403 | body: zfxstimebody, 404 | } 405 | $.post(url, async (err, resp, data) => { 406 | try { 407 | 408 | const result = JSON.parse(data) 409 | 410 | if (result.status == 200) { 411 | 412 | console.log(`【开始刷时长】:${result.message}\n`) 413 | if(result.data.next_tasks == null){ 414 | console.log(`【刷时长失败,请稍后再来试】\n`) 415 | $.message += `【刷时长失败,请稍后再来试】\n` 416 | }else{ 417 | console.log(`【刷时长】:${result.message}\n`) 418 | $.message += `【刷时长】:${result.message}\n` 419 | } 420 | 421 | 422 | } else { 423 | 424 | console.log(`【开始刷时长失败】:${result.message}\n`) 425 | 426 | } 427 | } catch (e) { 428 | 429 | } finally { 430 | 431 | resolve() 432 | } 433 | }, timeout) 434 | }) 435 | } 436 | 437 | 438 | function message() { 439 | if (tz == 1) { $.msg($.name, "", $.message) } 440 | } 441 | //时间 442 | nowTimes = new Date( 443 | new Date().getTime() + 444 | new Date().getTimezoneOffset() * 60 * 1000 + 445 | 8 * 60 * 60 * 1000 446 | ); 447 | 448 | function RT(X, Y) { 449 | do rt = Math.floor(Math.random() * Y); 450 | while (rt < X) 451 | return rt; 452 | } 453 | 454 | 455 | //console.log('\n'+getCurrentDate()); 456 | function getCurrentDate() { 457 | var date = new Date(); 458 | var seperator1 = "-"; 459 | var seperator2 = ":"; 460 | var month = date.getMonth() + 1; 461 | var strDate = date.getDate(); 462 | if (month >= 1 && month <= 9) { 463 | month = "0" + month; 464 | } 465 | if (strDate >= 0 && strDate <= 9) { 466 | strDate = "0" + strDate; 467 | } 468 | var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate 469 | + " " + date.getHours() + seperator2 + date.getMinutes() 470 | + seperator2 + date.getSeconds(); 471 | return currentdate; 472 | 473 | 474 | } 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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)} 483 | --------------------------------------------------------------------------------